From 3652d851f7bb084d32091eda2d658e2ead059fae Mon Sep 17 00:00:00 2001 From: Mayank Mishra Date: Tue, 9 Dec 2025 15:02:15 +0530 Subject: [PATCH] Enhance email notifications for host application approvals and rejections by including the host's first name in the greeting. --- .../handlers/hosthub/hosts/acceptHostApplication.ts | 2 +- .../handlers/hosthub/hosts/rejectHostApplicationAM.ts | 2 +- .../minglaradmin/services/approvalMailtoHost.service.ts | 3 ++- .../minglaradmin/services/rejectionMailtoHost.service.ts | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/modules/minglaradmin/handlers/hosthub/hosts/acceptHostApplication.ts b/src/modules/minglaradmin/handlers/hosthub/hosts/acceptHostApplication.ts index 803d32d..f3fef25 100644 --- a/src/modules/minglaradmin/handlers/hosthub/hosts/acceptHostApplication.ts +++ b/src/modules/minglaradmin/handlers/hosthub/hosts/acceptHostApplication.ts @@ -47,7 +47,7 @@ export const handler = safeHandler(async ( // Add suggestion using service await minglarService.acceptHostApplication(hostXid, userInfo.id); const hostDetails = await minglarService.getUserDetails(hostXid) - await sendEmailToHostForApprovedApplication(hostDetails.emailAddress) + await sendEmailToHostForApprovedApplication(hostDetails.emailAddress, hostDetails.firstName) return { statusCode: 200, diff --git a/src/modules/minglaradmin/handlers/hosthub/hosts/rejectHostApplicationAM.ts b/src/modules/minglaradmin/handlers/hosthub/hosts/rejectHostApplicationAM.ts index 2539f75..4e47a59 100644 --- a/src/modules/minglaradmin/handlers/hosthub/hosts/rejectHostApplicationAM.ts +++ b/src/modules/minglaradmin/handlers/hosthub/hosts/rejectHostApplicationAM.ts @@ -47,7 +47,7 @@ export const handler = safeHandler(async ( // Add suggestion using service await minglarService.rejectHostApplicationAM(hostXid, userInfo.id); const hostDetails = await minglarService.getUserDetails(hostXid) - await sendAMRejectionMailtoHost(hostDetails.emailAddress) + await sendAMRejectionMailtoHost(hostDetails.emailAddress, hostDetails.firstName) return { statusCode: 200, diff --git a/src/modules/minglaradmin/services/approvalMailtoHost.service.ts b/src/modules/minglaradmin/services/approvalMailtoHost.service.ts index 30a8e24..1272623 100644 --- a/src/modules/minglaradmin/services/approvalMailtoHost.service.ts +++ b/src/modules/minglaradmin/services/approvalMailtoHost.service.ts @@ -4,6 +4,7 @@ import config from "../../../config/config"; export async function sendEmailToHostForApprovedApplication( emailAddress: string, + name: string ): Promise<{ sent: boolean; // messageId: string @@ -12,7 +13,7 @@ export async function sendEmailToHostForApprovedApplication( const subject = "Approval for your application"; const htmlContent = ` -

Dear Host,

+

Dear ${name},

Congratulations, Your application to minglar admin has been approved.

You can start onboarding your activities through the host panel.

You can login to your account using the link below:
diff --git a/src/modules/minglaradmin/services/rejectionMailtoHost.service.ts b/src/modules/minglaradmin/services/rejectionMailtoHost.service.ts index 62ddb32..6cec2f1 100644 --- a/src/modules/minglaradmin/services/rejectionMailtoHost.service.ts +++ b/src/modules/minglaradmin/services/rejectionMailtoHost.service.ts @@ -39,6 +39,7 @@ export async function sendEmailToHostForRejectedApplication( export async function sendAMRejectionMailtoHost( emailAddress: string, + name: string ): Promise<{ sent: boolean; // messageId: string @@ -47,7 +48,7 @@ export async function sendAMRejectionMailtoHost( const subject = "Improvement of your application"; const htmlContent = ` -

Dear Host,

+

Dear ${name},

Your account manager has reviewed your application and provided some suggestions.
Please make the necessary improvements and re-submit your application to proceed with the onboarding process on Minglar.

You may access your application using the link below: