2 Commits

10 changed files with 142 additions and 129 deletions

View File

@@ -10,13 +10,16 @@ export async function resendOtpEmail(
// messageId: string
}> {
const subject = "New OTP from Minglar Team";
const subject = "Your Minglar Verification Code";
const htmlContent = `
<p>Dear ${role},</p>
<p>Your new OTP is: <strong>${otp}</strong></p>
<p>This code will be valid for the next 5 minutes.</p>
<p>Warm regards,<br/>Minglar Team</p>
<p>Hi ${role},</p>
<p>Here's your verification code to get started:</p>
<p><strong>${otp}</strong></p>
<p>This code is valid for the next 5 minutes.</p>
<p>Once verified, you can continue setting up your Minglar account. If you didn't request this, you can safely ignore this email.</p>
<p>Need help? Reach out to us at info@minglargroup.com.</p>
<p>Warm regards,<br/>Team Minglar</p>
`;
try {
@@ -37,3 +40,5 @@ export async function resendOtpEmail(
throw new ApiError(500, "Failed to send OTP to host via email.");
}
}

View File

@@ -11,13 +11,14 @@ export async function sendEmailToAM(
// messageId: string
}> {
const subject = `Host Application Re-Submited : ${hostCompanyName}`;
const subject = `${hostCompanyName} Has Resubmitted Their Application`;
const htmlContent = `
<p>Dear ${amName},</p>
<p>Host ${hostCompanyName} with reference number: <strong>${hostRefNumber}</strong> has re-submited the application with implimented suggestions.</p>
<p>Please review their appliaction and take the necessary action.</p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hello ${amName},</p>
<p>${hostCompanyName} has updated and re-submitted their application for your review.</p>
<p>Reference number: <strong>${hostRefNumber}</strong></p>
<p>Please log in to your dashboard to review the revised submission and proceed with the necessary action.</p>
<p>Thank you,<br/>Minglar Team</p>
`;
try {
@@ -49,13 +50,14 @@ export async function sendEmailToMinglarAdmin(
// messageId: string
}> {
const subject = `New Host Application Recieved : ${hostCompanyName}`;
const subject = "New Host Application Submitted for Review";
const htmlContent = `
<p>Dear ${minglarAdminName},</p>
<p>Host ${hostCompanyName} with reference number: <strong>${hostRefNumber}</strong> has submited their application.</p>
<p>Please review their appliaction and take the necessary action.</p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hi ${minglarAdminName},</p>
<p>${hostCompanyName} has submitted their application and is awaiting your review.</p>
<p>Reference number: <strong>${hostRefNumber}</strong></p>
<p>Please log in to your dashboard to review the submission and take the necessary action.</p>
<p>Thank you,<br/>Minglar Team</p>
`;
try {
@@ -87,13 +89,14 @@ export async function sendPQPEmailToAM(
// messageId: string
}> {
const subject = `New Pre-qualification Questionnaire from : ${hostCompanyName}`;
const subject = "New Host Application Submitted for Review";
const htmlContent = `
<p>Dear ${minglarAdminName},</p>
<p>Host ${hostCompanyName} with reference number: <strong>${hostRefNumber}</strong> has submited their pre-qualification questionnaire.</p>
<p>Please review their appliaction and take the necessary action.</p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hi ${minglarAdminName},</p>
<p>${hostCompanyName} has submitted the pre-qualification details and is awaiting your review.</p>
<p>Reference number: <strong>${hostRefNumber}</strong></p>
<p>Please log in to your dashboard to review the submission and take the necessary action.</p>
<p>Thank you,<br/>Minglar Team</p>
`;
try {
@@ -114,3 +117,4 @@ export async function sendPQPEmailToAM(
throw new ApiError(500, "Failed to send OTP to host via email.");
}
}

View File

@@ -13,13 +13,13 @@ export async function sendOtpEmailForHost(
const subject = "Your Minglar Verification Code";
const htmlContent = `
<p>Hi there 👋</p>
<p>Heres your verification code to get started:</p>
<p>Hi there,</p>
<p>Here's your verification code to get started:</p>
<p><strong>${otp}</strong></p>
<p>This code is valid for the next 5 minutes.</p>
<p>Once verified, you can continue setting up your Minglar account. If you didnt request this, you can safely ignore this email.</p>
<p>Once verified, you can continue setting up your Minglar account. If you didn't request this, you can safely ignore this email.</p>
<p>Need help? Reach out to us at info@minglargroup.com.</p>
<p>Warm regards,<br/><strong>Team Minglar</strong></p>
<p>Warm regards,<br/>Team Minglar</p>
`;
try {
@@ -51,18 +51,19 @@ export async function sendWelcomeEmailToHost(
const subject = "Get Started as a Minglar Host";
const htmlContent = `
<p>Hi ${emailAddress}</p><br/>
<p>Were excited to have you join Minglar as a host. Welcome aboard! 🌟</p><br/>
<p>To get started and bring your activities live, heres what comes next:</p><br/>
<p><strong>Your next steps:</strong></p><br/>
<p>1. Complete your host profile</p><br/>
<p>2. Complete the pre-qualification process for all your activities</p><br/>
<p>3. Submit your activity details for review</p><br/>
<p>4. Go live and start receiving bookings</p><br/>
<p><strong>👉 Access your Host Portal:</strong></p><br/>
<p>${config.HOST_LINK}</p><br/><br/>
<p>If you need any support along the way, our team is always here to help. You can reach us anytime at info@minglargroup.com.</p><br/>
<p>Were looking forward to seeing your experiences come to life on Minglar.</p><br/>
<p>Hi ${emailAddress},</p>
<p>We're excited to have you join Minglar as a host. Welcome aboard!</p>
<p>To get started and bring your activities live, here's what comes next:</p>
<p><strong>Your next steps:</strong></p>
<p>1. Complete your host profile</p>
<p>2. Complete the pre-qualification process for all your activities</p>
<p>3. Submit your activity details for review</p>
<p>4. Go live and start receiving bookings</p>
<p><strong>Access your Host Portal:</strong><br/>
<a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a>
</p>
<p>If you need any support along the way, our team is always here to help. You can reach us anytime at info@minglargroup.com.</p>
<p>We're looking forward to seeing your experiences come to life on Minglar.</p>
<p>Warm regards,<br/>Team Minglar</p>
`;
@@ -84,3 +85,4 @@ export async function sendWelcomeEmailToHost(
throw new ApiError(500, "Failed to send OTP to host via email.");
}
}

View File

@@ -2,18 +2,19 @@
import { brevoService } from '@/common/email/brevoApi';
import ApiError from '@/common/utils/helper/ApiError';
export async function sendAMEmailForHostAssign(emailAddress: string): Promise<{
export async function sendAMEmailForHostAssign(emailAddress: string, accountManagerName?: string): Promise<{
sent: boolean;
// messageId: string
}> {
const subject = 'Minglar Admin: Host Assignment Notification';
const subject = "You've Been Assigned a New Host";
const displayName = accountManagerName?.trim() || "there";
const htmlContent = `
<p>Hi,</p>
<p>Youve been assigned the <strong>Host</strong> role by Minglar Admin.</p>
<p>Best regards,<br/>Minglar Admin Team</p>
<p>Hi ${displayName},</p>
<p>A new host has been assigned to you by the Minglar team.</p>
<p>You can now manage and support this host through your admin dashboard. Log in to review the host's details, connect with them, and take the next steps as needed.</p>
<p>Warm regards,<br/>Minglar Team</p>
`;
try {
@@ -35,3 +36,5 @@ export async function sendAMEmailForHostAssign(emailAddress: string): Promise<{
}
}
// ...existing code...

View File

@@ -24,7 +24,8 @@ export class AMNotificationService {
}
try {
await sendAMEmailForHostAssign(amUser.emailAddress);
const amName = [amUser.firstName, amUser.lastName].filter(Boolean).join(' ').trim();
await sendAMEmailForHostAssign(amUser.emailAddress, amName);
return true;
} catch (err) {
console.error('Error sending AM assignment email', err);

View File

@@ -10,15 +10,16 @@ export async function sendEmailToHostForApprovedApplication(
// messageId: string
}> {
const subject = "Approval for your application";
const subject = "Host Onboarding Application Approved";
const htmlContent = `
<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/>
<strong>Link:</strong> ${config.HOST_LINK} </p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hi ${name},</p>
<p>We're pleased to inform you that your host onboarding application has been approved by our team.</p>
<p>You can now proceed with completing your activity pre-qualification process.</p>
<p>Please click the link below to log in to your account and continue:</p>
<p><a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a></p>
<p>If you have any questions or need assistance, feel free to reach out to us at info@minglargroup.com.</p>
<p>Warm regards,<br/>Minglar Team</p>
`;
try {
@@ -47,13 +48,16 @@ export async function sendEmailToHostForMinglarApproval(
// messageId: string
}> {
const subject = "Approval for your application";
const subject = "Host Onboarding Application Approved";
const htmlContent = `
<p>Dear Host,</p>
<p>Congratulations, Your application to minglar admin has been approved by minglar admin.</p>
<p>Minglar admin will assign account manager to your application.</p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hi there,</p>
<p>We're pleased to inform you that your host onboarding application has been approved by our team.</p>
<p>You can now proceed with completing your activity pre-qualification process.</p>
<p>Please click the link below to log in to your account and continue:</p>
<p><a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a></p>
<p>If you have any questions or need assistance, feel free to reach out to us at info@minglargroup.com.</p>
<p>Warm regards,<br/>Minglar Team</p>
`;
try {
@@ -87,12 +91,12 @@ export async function sendAMPQQAcceptanceMailtoHost(
const htmlContent = `
<p>Hi ${name},</p>
<p>Were pleased to inform you that your activity has been qualified on the Minglar platform.</p>
<p>We're pleased to inform you that your activity has been qualified on the Minglar platform.</p>
<p>You can now proceed to complete the details of your activity through the Host portal.</p>
<p>Please click the link below to log in to your account and continue:<br/>
<p>Please click the link below to log in to your account and continue:</p>
<p><a href="${config.HOST_LINK_PQ}" target="_blank">${config.HOST_LINK_PQ}</a></p>
<p>If you have any questions or need assistance, feel free to reach out at info@minglargroup.com.</p>
<p>Warm regards,<br/><strong>Team Minglar</strong></p>
<p>Warm regards,<br/>Minglar Team</p>
`;
try {
@@ -122,15 +126,19 @@ export async function sendActivityAcceptanceMailtoHost(
// messageId: string
}> {
const subject = "Approval for your activity details application";
const subject = "Onboarding Completed | You Can Now Set Up Your Activity Schedule and Listing";
const htmlContent = `
<p>Dear ${name},</p>
<p>Congratulations, Your activity details application to minglar admin has been approved.</p>
<p>You can start getting orders for your activity.</p>
<p>You can login to your account using the link below:<br/>
<strong>Link:</strong> ${config.HOST_LINK} </p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hi ${name},</p>
<p>Great news!</p>
<p>You have successfully completed the onboarding process for your activity on Minglar.</p>
<p>You can now move on to the next step by setting up your activity's schedule. Once this is done, your activity will be ready to be listed on the Minglar app.</p>
<p><strong>Access your Host Portal:</strong><br/>
<a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a>
</p>
<p>If you have any questions or need assistance while setting things up, our team is here to help at info@minglargroup.com.</p>
<p>We're excited to see your activity take shape and look forward to having it live on Minglar soon.</p>
<p>Warm regards,<br/>Team Minglar</p>
`;
try {
@@ -151,3 +159,5 @@ export async function sendActivityAcceptanceMailtoHost(
throw new ApiError(500, "Failed to send OTP to minglar admin via email.");
}
}

View File

@@ -9,22 +9,16 @@ export async function sendInvitationEmailForMinglarAdmin(
// messageId: string
}> {
const subject = "Minglar Admin: Your Team Invitation";
const subject = "Team Invitation: Account Manager at Minglar";
const htmlContent = `
<p>Hi there,</p>
<p>We're excited to invite you to join the <strong>Minglar Admin Team</strong>!<br/>
Please use the link below to set up your account and get started.</p>
<p><strong>Access Your Invitation:</strong><br/>
<a href="${link}">${link}</a></p>
<p>If you have any questions or need assistance, feel free to reach out — were here to help.<br/>
We look forward to having you on board!</p>
<p>Welcome aboard!<br/>
<strong>The Minglar Admin Team</strong></p>
<p>Hi ${emailAddress},</p>
<p>We're happy to invite you to join the Minglar team as an Account Manager.</p>
<p>To get started, please set up your account using the link below:</p>
<p><a href="${link}" target="_blank">${link}</a></p>
<p>If you have any questions or need help during the setup process, feel free to reach out.</p>
<p>We look forward to working with you.</p>
<p>Warm regards,<br/>Minglar Team</p>
`;
try {
@@ -45,3 +39,4 @@ We look forward to having you on board!</p>
throw new ApiError(500, "Failed to send invitation via email.");
}
}

View File

@@ -1411,7 +1411,7 @@ export class MinglarService {
const amUser = await this.prisma.user.findUnique({
where: { id: accountManagerXid, isActive: true },
select: { emailAddress: true },
select: { emailAddress: true, firstName: true, lastName: true },
});
if (!amUser || !amUser.emailAddress) {
@@ -1422,7 +1422,8 @@ export class MinglarService {
}
try {
await sendAMEmailForHostAssign(amUser.emailAddress);
const amName = [amUser.firstName, amUser.lastName].filter(Boolean).join(' ').trim();
await sendAMEmailForHostAssign(amUser.emailAddress, amName);
return true;
} catch (err) {
console.error('Error sending AM assignment email', err);

View File

@@ -13,12 +13,13 @@ export async function sendEmailToHostForRejectedApplication(
const subject = "Action Needed: Host Onboarding Application";
const htmlContent = `
<p>Hi ${firstName},</p><br/><br/>
<p>After reviewing your submission, were unable to proceed at this stage, as some details require further updates.<br/>
We encourage you to log in to your Host portal to review the feedback provided and make the necessary changes.</p><br/><br/>
<p>Host portal login : ${config.HOST_LINK}</p><br/><br/>
<p>We appreciate your interest in Minglar and look forward to reviewing your updated application.</p><br/><br/>
<p>Warm regards,<br/><strong>Team Minglar</strong></p>
<p>Hi ${firstName},</p>
<p>After reviewing your submission, we're unable to proceed at this stage, as some details require further updates. We encourage you to log in to your Host portal to review the feedback provided and make the necessary changes.</p>
<p><strong>Host portal login:</strong><br/>
<a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a>
</p>
<p>We appreciate your interest in Minglar and look forward to reviewing your updated application.</p>
<p>Warm regards,<br/>Team Minglar</p>
`;
try {
@@ -53,15 +54,10 @@ export async function sendAMRejectionMailtoHost(
const htmlContent = `
<p>Hi ${name},</p>
<p>After reviewing your submission, were unable to proceed at this stage, as some details require further updates. <br/>
We encourage you to log in to your Host portal to review the feedback provided and make the necessary changes.</p><br/><br/>
<p><a href="${link}" target="_blank">
${link}
</a>
</p>
<p>After reviewing your submission, we're unable to proceed at this stage, as some details require further updates. We encourage you to log in to your Host portal to review the feedback provided and make the necessary changes.</p>
<p><a href="${link}" target="_blank">${link}</a></p>
<p>We appreciate your interest in Minglar and look forward to reviewing your updated application.</p>
<p>Warm regards,<br/>
<strong>Team Minglar</strong></p>
<p>Warm regards,<br/>Team Minglar</p>
`;
try {
@@ -95,20 +91,14 @@ export async function sendAMPQQRejectionMailtoHost(
const subject = "Action Needed: Activity Pre-qualification";
const htmlContent = `
<p>Hi ${name},</p><br/><br/>
<p>Thank you for taking the time to submit your activity pre-qualification detaills on the Minglar platform.<br/><br/>
After reviewing your submission, were unable to approve the application at this stage. However, we encourage you to make the suggested updates and refinements, as many applications are successfully approved after revision.</p><br/><br/>
<p>You can log in to the Host portal to review the feedback and continue updating your application:<br/>
<a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a></p><br/><br/>
<p>If you need any guidance, feel free to reach out to us at info@minglargroup.com.</p><br/><br/>
<p>We appreciate your interest in partnering with Minglar and look forward to reviewing your updated submission.</p><br/><br/>
<p>Warm regards,<br/>
<strong>Minglar Team</strong></p>
<p>Hi ${name},</p>
<p>Thank you for taking the time to submit your activity pre-qualification details on the Minglar platform.</p>
<p>After reviewing your submission, we're unable to approve the application at this stage. However, we encourage you to make the suggested updates and refinements, as many applications are successfully approved after revision.</p>
<p>You can log in to the Host portal to review the feedback and continue updating your application:</p>
<p><a href="${config.HOST_LINK_PQ}" target="_blank">${config.HOST_LINK_PQ}</a></p>
<p>If you need any guidance, feel free to reach out to us at info@minglargroup.com.</p>
<p>We appreciate your interest in partnering with Minglar and look forward to reviewing your updated submission.</p>
<p>Thank you,<br/>Minglar Team</p>
`;
try {
@@ -139,22 +129,19 @@ export async function sendActivityRejectionMailtoHost(
// messageId: string
}> {
const subject = "Improvement of your activity onboarding application";
const subject = "Action Needed: Activity Onboarding";
const htmlContent = `
<p>Dear ${name},</p>
<p>Your account manager has reviewed your activity application and provided some suggestions.<br/>
Please make the necessary improvements and re-submit your activity application along with the pre-qualification answers to proceed with the onboarding process on Minglar.</p>
<p>You may access your activity onboarding application using the link below:<br/>
<strong>Link:</strong> ${config.HOST_LINK}</p>
<p>If you have any questions, please feel free to contact the Minglar Support Team.</p>
<p>Best regards,<br/>
<strong>Minglar Team</strong></p>
<p>Hi ${name},</p>
<p>Thank you for submitting your activity for review.</p>
<p>After evaluating the details provided, we're unable to approve the listing at this stage. A few updates are required before we can proceed.</p>
<p>Please log in to your Host Portal to review the feedback and make the necessary revisions.</p>
<p><strong>Access your Host Portal:</strong><br/>
<a href="${config.HOST_LINK}" target="_blank">${config.HOST_LINK}</a>
</p>
<p>Once the updates have been submitted, our team will re-evaluate your activity promptly.</p>
<p>If you have any questions or need clarification on the feedback, feel free to reach out to us at info@minglargroup.com. We're happy to assist.</p>
<p>Warm regards,<br/>The Minglar Team</p>
`;
try {
@@ -175,3 +162,4 @@ export async function sendActivityRejectionMailtoHost(
throw new ApiError(500, "Failed to send OTP to minglar admin via email.");
}
}

View File

@@ -9,13 +9,16 @@ export async function sendOtpEmailForMinglarAdmin(
// messageId: string
}> {
const subject = "OTP for Minglar Admin Registration";
const subject = "Your Minglar Verification Code";
const htmlContent = `
<p>Dear User,</p>
<p>Your OTP for minglar admin registration is: <strong>${otp}</strong></p>
<p>This code is valid for 5 minutes. Please do not share it with anyone.</p>
<p>Best regards,<br/>Minglar Team</p>
<p>Hi there,</p>
<p>To continue your Minglar Admin registration, please use the following One-Time Password (OTP):</p>
<p><strong>${otp}</strong></p>
<p>This code is valid for 5 minutes.</p>
<p>For your security, please do not share this code with anyone.</p>
<p>If you did not request this OTP, please ignore this email.</p>
<p>Warm regards,<br/>Minglar Team</p>
`;
try {
@@ -36,3 +39,4 @@ export async function sendOtpEmailForMinglarAdmin(
throw new ApiError(500, "Failed to send OTP to minglar admin via email.");
}
}