Enhance email notifications for host application approvals and rejections by including the host's first name in the greeting.

This commit is contained in:
2025-12-09 15:02:15 +05:30
parent 6166075967
commit 3652d851f7
4 changed files with 6 additions and 4 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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 = `
<p>Dear Host,</p>
<p>Dear ${name},</p>
<p>Congratulations, Your application to minglar admin has been approved.</p>
<p>You can start onboarding your activities through the host panel.</p>
<p> You can login to your account using the link below:<br/>

View File

@@ -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 = `
<p>Dear Host,</p>
<p>Dear ${name},</p>
<p> Your account manager has reviewed your application and provided some suggestions. <br/>
Please make the necessary improvements and re-submit your application to proceed with the onboarding process on Minglar.</p>
<p> You may access your application using the link below:<br/>