Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/issue 76 #8

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# USupport-email
USupport email Node.js API service
# uSupport-email
uSupport email Node.js API service

This service handles the sending of emails to users, providers and admins in the USupport project.
This service handles the sending of emails to users, providers and admins in the uSupport project.

For detailed instructions on how to run the service, please refer to the [USupport-entry-bundle](https://github.com/UNICEFECAR/USupport-entry-bundle)
For detailed instructions on how to run the service, please refer to the [uSupport-entry-bundle](https://github.com/UNICEFECAR/USupport-entry-bundle)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "admin",
"version": "1.0.0",
"description": "USupport admin Node.js API service",
"description": "uSupport admin Node.js API service",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
4 changes: 2 additions & 2 deletions service/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EMAIL_SENDER = process.env.EMAIL_SENDER;
const FRONTEND_URL = process.env.FRONTEND_URL;

export const sendAdminEmail = async ({ country, subject, title, text }) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const countryId = await getCountryIdByAlpha2CodeQuery({ alpha2: country })
.then((res) => {
Expand Down Expand Up @@ -63,7 +63,7 @@ export const sendRegistrationNotify = async ({
password,
adminRole,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("admin_registration_notify_subject", language);
const title = t("admin_registration_notify_title", language);
Expand Down
36 changes: 18 additions & 18 deletions service/controllers/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const sendConsultationConfirmBookingEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("client_consultation_confirm_booking_subject", language);
const title = t("client_consultation_confirm_booking_title", language);
Expand Down Expand Up @@ -43,7 +43,7 @@ export const sendConsultationConfirmRescheduleEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("client_consultation_confirm_reschedule_subject", language);
const title = t("client_consultation_confirm_reschedule_title", language);
Expand Down Expand Up @@ -75,11 +75,11 @@ export const sendConsultationConfirmCancellationEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"client_consultation_confirm_cancellation_subject",
language,
language
);
const title = t("client_consultation_confirm_cancellation_title", language);
const platformLink = `${FRONTEND_URL}/client`;
Expand Down Expand Up @@ -110,11 +110,11 @@ export const sendConsultationNotifyCancellationEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"client_consultation_notify_cancellation_subject",
language,
language
);
const title = t("client_consultation_notify_cancellation_title", language);
const platformLink = `${FRONTEND_URL}/client`;
Expand Down Expand Up @@ -146,7 +146,7 @@ export const sendConsultationRemindStartEmail = async ({
recipientEmail,
minToConsultation,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("client_consultation_remind_start_subject", language);
const title = t("client_consultation_remind_start_title", language);
Expand Down Expand Up @@ -179,7 +179,7 @@ export const sendConsultationHasStartedReminderEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("consultation_started_remind_subject", language);
const title = t("consultation_started_remind_title", language);
Expand Down Expand Up @@ -211,7 +211,7 @@ export const sendConsultationNotifySuggestionEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("client_consultation_notify_suggestion_subject", language);
const title = t("client_consultation_notify_suggestion_title", language);
Expand Down Expand Up @@ -243,22 +243,22 @@ export const sendConsultationConfirmSuggestionBookingEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"client_consultation_confirm_suggestion_booking_subject",
language,
language
);
const title = t(
"client_consultation_confirm_suggestion_booking_title",
language,
language
);
const platformLink = `${FRONTEND_URL}/client`;
const platformLinkAnchor = `<a href=${platformLink}>${platformLink}</a>`;
const text = t(
"client_consultation_confirm_suggestion_booking_text",
language,
[platformLinkAnchor],
[platformLinkAnchor]
);

let computedHTML = GeneralTemplate(title, text);
Expand All @@ -283,22 +283,22 @@ export const sendConsultationConfirmSuggestionCancellationEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"client_consultation_confirm_suggestion_cancellation_subject",
language,
language
);
const title = t(
"client_consultation_confirm_suggestion_cancellation_title",
language,
language
);
const platformLink = `${FRONTEND_URL}/client`;
const platformLinkAnchor = `<a href=${platformLink}>${platformLink}</a>`;
const text = t(
"client_consultation_confirm_suggestion_cancellation_text",
language,
[platformLinkAnchor],
[platformLinkAnchor]
);

let computedHTML = GeneralTemplate(title, text);
Expand All @@ -324,7 +324,7 @@ export const sendRegistrationOtpToUsersEmail = async ({
recipientEmail,
otp,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("client_registration_otp_subject", language);
const title = t("client_registration_otp_title", language);
Expand Down
50 changes: 25 additions & 25 deletions service/controllers/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const sendConsultationNotifyBookingEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("provider_consultation_notify_booking_subject", language);
const title = t("provider_consultation_notify_booking_title", language);
Expand Down Expand Up @@ -46,11 +46,11 @@ export const sendConsultationNotifyRescheduleEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_consultation_notify_reschedule_subject",
language,
language
);
const title = t("provider_consultation_notify_reschedule_title", language);
const platformLink = `${FRONTEND_URL}/provider`;
Expand Down Expand Up @@ -81,11 +81,11 @@ export const sendConsultationNotifyCancellationEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_consultation_notify_cancellation_subject",
language,
language
);
const title = t("provider_consultation_notify_cancellation_title", language);
const platformLink = `${FRONTEND_URL}/provider`;
Expand Down Expand Up @@ -116,11 +116,11 @@ export const sendConsultationConfirmCancellationEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_consultation_confirm_cancellation_subject",
language,
language
);
const title = t("provider_consultation_confirm_cancellation_title", language);
const platformLink = `${FRONTEND_URL}/provider`;
Expand Down Expand Up @@ -152,7 +152,7 @@ export const sendConsultationRemindStartEmail = async ({
recipientEmail,
minToConsultation,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("provider_consultation_remind_start_subject", language);
const title = t("provider_consultation_remind_start_title", language);
Expand Down Expand Up @@ -185,7 +185,7 @@ export const sendConsultationHasStartedReminderEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("consultation_started_remind_subject", language);
const title = t("consultation_started_remind_title", language);
Expand Down Expand Up @@ -217,11 +217,11 @@ export const sendConsultationConfirmSuggestionEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_consultation_confirm_suggestion_subject",
language,
language
);
const title = t("provider_consultation_confirm_suggestion_title", language);
const platformLink = `${FRONTEND_URL}/provider`;
Expand Down Expand Up @@ -252,22 +252,22 @@ export const sendConsultationNotifySuggestionBookingEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_consultation_notify_suggestion_booking_subject",
language,
language
);
const title = t(
"provider_consultation_notify_suggestion_booking_title",
language,
language
);
const platformLink = `${FRONTEND_URL}/provider`;
const platformLinkAnchor = `<a href=${platformLink}>${platformLink}</a>`;
const text = t(
"provider_consultation_notify_suggestion_booking_text",
language,
[platformLinkAnchor],
[platformLinkAnchor]
);

let computedHTML = GeneralTemplate(title, text);
Expand All @@ -292,22 +292,22 @@ export const sendConsultationNotifySuggestionCancellationEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_consultation_notify_suggestion_cancellation_subject",
language,
language
);
const title = t(
"provider_consultation_notify_suggestion_cancellation_title",
language,
language
);
const platformLink = `${FRONTEND_URL}/provider`;
const platformLinkAnchor = `<a href=${platformLink}>${platformLink}</a>`;
const text = t(
"provider_consultation_notify_suggestion_cancellation_text",
language,
[platformLinkAnchor],
[platformLinkAnchor]
);

let computedHTML = GeneralTemplate(title, text);
Expand All @@ -332,15 +332,15 @@ export const sendAvailabilityRemindAddMoreSlotsEmail = async ({
language,
recipientEmail,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t(
"provider_availability_remind_add_more_slots_subject",
language,
language
);
const title = t(
"provider_availability_remind_add_more_slots_title",
language,
language
);
const platformLink = `${FRONTEND_URL}/provider`;
const platformLinkAnchor = `<a href=${platformLink}>${platformLink}</a>`;
Expand Down Expand Up @@ -371,7 +371,7 @@ export const sendReportWeeklyEmail = async ({
recipientEmail,
csvData,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("provider_report_weekly_subject", language);
const title = t("provider_report_weekly_title", language);
Expand Down Expand Up @@ -413,7 +413,7 @@ export const sendReportMonthlyEmail = async ({
recipientEmail,
csvData,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("provider_report_monthly_subject", language);
const title = t("provider_report_monthly_title", language);
Expand Down Expand Up @@ -458,7 +458,7 @@ export const sendRegistrationNotify = async ({
recipientEmail,
password,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("provider_registration_notify_subject", language);
const title = t("provider_registration_notify_title", language);
Expand Down
6 changes: 3 additions & 3 deletions service/controllers/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const sendForgotPasswordEmail = async ({
platform,
forgotPasswordToken,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("system_forgot_password_subject", language);
const title = t("system_forgot_password_title", language);
Expand Down Expand Up @@ -46,7 +46,7 @@ export const sendWelcomeEmail = async ({
language,
platform,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("system_welcome_subject", language);
const title = t("system_welcome_title", language);
Expand Down Expand Up @@ -77,7 +77,7 @@ export const sendLogin2FARequest = async ({
recipientEmail,
otp,
}) => {
const from = `USupport <${EMAIL_SENDER}>`;
const from = `uSupport <${EMAIL_SENDER}>`;

const subject = t("system_login_2fa_request_subject", language);
const title = t("system_login_2fa_request_title", language);
Expand Down
2 changes: 1 addition & 1 deletion service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"name": "email",
"version": "1.0.0",
"description": "Express.js app for the USupport email API service",
"description": "Express.js app for the uSupport email API service",
"main": "server.js",
"scripts": {
"dev": "nodemon server.js",
Expand Down
Loading
Loading