diff --git a/src/config/config.ts b/src/config/config.ts index 063ee60..02835f1 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -83,6 +83,7 @@ const envVarsSchema = yup BYPASS_OTP: yup.boolean().default(false).required('Bypass OTP is required'), // Email links AM_INVITATION_LINK: yup.string().required('Link to send in AM invitation mail is required'), + AM_INTERFACE_LINK:yup.string().required('Link to am interface is required'), HOST_LINK: yup.string().required('Link to host panel is required'), HOST_LINK_PQ: yup.string().required('Link to host panel pqp is required'), RAZORPAY_KEY_SECRET: yup.string().required('Razorpay key secret is required'), @@ -171,6 +172,7 @@ function getConfig() { RAZORPAY_KEY_ID: envVars.RAZORPAY_KEY_ID, RAZORPAY_KEY_SECRET: envVars.RAZORPAY_KEY_SECRET, RAZORPAY_WEBHOOK_SECRET: envVars.RAZORPAY_WEBHOOK_SECRET, + AM_INTERFACE_LINK: envVars.AM_INTERFACE_LINK, // oneSignal: { // appID: envVars.ONESIGNAL_APPID, diff --git a/src/modules/host/services/sendHostResubmitEmailToAM.service.ts b/src/modules/host/services/sendHostResubmitEmailToAM.service.ts index 3763255..cfcd497 100644 --- a/src/modules/host/services/sendHostResubmitEmailToAM.service.ts +++ b/src/modules/host/services/sendHostResubmitEmailToAM.service.ts @@ -1,11 +1,12 @@ import { brevoService } from "@/common/email/brevoApi"; import ApiError from "@/common/utils/helper/ApiError"; +import config from '../../../config/config'; export async function sendEmailToAM( emailAddress: string, amName: string, hostCompanyName: string, - hostRefNumber: string + activityName: string ): Promise<{ sent: boolean; // messageId: string @@ -13,13 +14,27 @@ export async function sendEmailToAM( const subject = `${hostCompanyName} Has Resubmitted Their Application`; - const htmlContent = ` -
Hello ${amName},
-${hostCompanyName} has updated and re-submitted their application for your review.
-Reference number: ${hostRefNumber}
-Please log in to your dashboard to review the revised submission and proceed with the necessary action.
-Thank you,
Minglar Team
Hello ${amName},
+ ++ ${hostCompanyName} has updated and re-submitted their pre-qualification details of ${activityName} for your review. +
+ ++ Please click on the link below to log in to your dashboard to review the revised submission and proceed with the necessary action. +
+ +
+ Review Application
+ ${config.AM_INTERFACE_LINK}
+
+ Thank you,
+ Minglar Team
+
Hi ${minglarAdminName},
-${hostCompanyName} has submitted the pre-qualification details and is awaiting your review.
-Reference number: ${hostRefNumber}
-Please log in to your dashboard to review the submission and take the necessary action.
-Thank you,
Minglar Team
Hi ${minglarAdminName},
+ ++ ${hostCompanyName} has submitted the pre-qualification details for ${activityName} and is awaiting your review. +
+ ++ Please click the link below to log in to your dashboard, review the submission, and take the necessary action: +
+ +
+ Review Application
+ ${config.HOST_LINK_PQ}
+
+ Thank you,
+ Minglar Team
+
Hi there,
-Here's your verification code to get started:
+Hi there 👋
+Here’s your verification code to get started:
${otp}
This code is valid for the next 5 minutes.
-Once verified, you can continue setting up your Minglar account. If you didn't request this, you can safely ignore this email.
+Once verified, you can continue setting up your Minglar account. If you didn’t request this, you can safely ignore this email.
Need help? Reach out to us at info@minglargroup.com.
-Warm regards,
Team Minglar
Warm regards,
Team Minglar
Hi ${emailAddress},
-We're excited to have you join Minglar as a host. Welcome aboard!
-To get started and bring your activities live, here's what comes next:
-Your next steps:
-1. Complete your host profile
-2. Complete the pre-qualification process for all your activities
-3. Submit your activity details for review
-4. Go live and start receiving bookings
-Access your Host Portal:
- ${config.HOST_LINK}
-
If you need any support along the way, our team is always here to help. You can reach us anytime at info@minglargroup.com.
-We're looking forward to seeing your experiences come to life on Minglar.
-Warm regards,
Team Minglar
Hi ${emailAddress},
+ +We’re excited to have you join Minglar as a host. Welcome aboard! 🌟
+ +To get started and bring your activities live, here’s what comes next:
+ +Your next steps:
+ +1. Complete your host profile
+2. Complete the pre-qualification process for all your activities
+3. Submit your activity details for review
+4. Go live and start receiving bookings
+ +
+ 👉 Access your Host Portal:
+ ${config.HOST_LINK}
+
+ If you need any support along the way, our team is always here to help. + You can reach us anytime at + info@minglargroup.com. +
+ ++ We’re looking forward to seeing your experiences come to life on Minglar. +
+ +
+ Warm regards,
+ Team Minglar
+
Hi ${displayName},
-A new host has been assigned to you by the Minglar team.
-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.
-Warm regards,
Minglar Team
Hi ${displayName},
+ ++ A new host has been assigned to you by the Minglar team. +
+ ++ 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. +
+ +
+ Warm regards,
+ Minglar Team
+
Hi ${emailAddress},
- const htmlContent = ` -Hi ${name},
-We're pleased to inform you that your host onboarding application has been approved by our team.
-You can now proceed with completing your activity pre-qualification process.
-Please click the link below to log in to your account and continue:
- -If you have any questions or need assistance, feel free to reach out to us at info@minglargroup.com.
-Warm regards,
Minglar Team
+ We’re pleased to inform you that your host onboarding application has been approved by our team. +
- try { - const result = await brevoService.sendEmail({ - recipients: [{ email: emailAddress }], - subject, - htmlContent, - }); ++ You can now proceed with completing your activity pre-qualification process. +
- console.log("📧 Email sent successfully:", result); ++ Please click the link below to log in to your account and continue: +
- return { - sent: true, - // messageId: result.messageId - }; - } catch (err) { - console.error("Brevo email send failed:", err); - throw new ApiError(500, "Failed to send OTP to minglar admin via email."); - } +
+ Host Portal Login
+ ${config.HOST_LINK}
+
+ If you have any questions or need assistance, feel free to reach out to us at + info@minglargroup.com. +
+ +
+ Warm regards,
+ Minglar Team
+
Hi there,
We're pleased to inform you that your host onboarding application has been approved by our team.
You can now proceed with completing your activity pre-qualification process.
@@ -60,104 +79,199 @@ export async function sendEmailToHostForMinglarApproval(Warm regards,
Minglar Team
Hi ${name},
- const htmlContent = ` -Hi ${name},
-We're pleased to inform you that your activity has been qualified on the Minglar platform.
-You can now proceed to complete the details of your activity through the Host portal.
-Please click the link below to log in to your account and continue:
- -If you have any questions or need assistance, feel free to reach out at info@minglargroup.com.
-Warm regards,
Minglar Team
+ We’re pleased to inform you that your activity has been qualified on the Minglar platform. +
- try { - const result = await brevoService.sendEmail({ - recipients: [{ email: emailAddress }], - subject, - htmlContent, - }); ++ You can now proceed to complete the details of your activity through the Host portal. +
- console.log("📧 Email sent successfully:", result); ++ Please click the link below to log in to your account and continue: +
- return { - sent: true, - // messageId: result.messageId - }; - } catch (err) { - console.error("Brevo email send failed:", err); - throw new ApiError(500, "Failed to send OTP to minglar admin via email."); - } +
+ Host Portal Login
+ ${config.HOST_LINK_PQ}
+
+ If you have any questions or need assistance, feel free to reach out at + info@minglargroup.com. +
+ +
+ Warm regards,
+ Minglar Team
+
Hi ${name},
- const htmlContent = ` -Hi ${name},
-Great news!
-You have successfully completed the onboarding process for your activity on Minglar.
-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.
-Access your Host Portal:
- ${config.HOST_LINK}
-
If you have any questions or need assistance while setting things up, our team is here to help at info@minglargroup.com.
-We're excited to see your activity take shape and look forward to having it live on Minglar soon.
-Warm regards,
Team Minglar
Great news! 🎉
- try { - const result = await brevoService.sendEmail({ - recipients: [{ email: emailAddress }], - subject, - htmlContent, - }); ++ You have successfully completed the onboarding process for your activity on Minglar. +
- console.log("📧 Email sent successfully:", result); ++ 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. +
- return { - sent: true, - // messageId: result.messageId - }; - } catch (err) { - console.error("Brevo email send failed:", err); - throw new ApiError(500, "Failed to send OTP to minglar admin via email."); - } +
+ 👉 Access your Host Portal:
+ ${config.HOST_LINK}
+
+ If you have any questions or need assistance while setting things up, our team is here to help at + info@minglargroup.com. +
+ ++ We’re excited to see your activity take shape and look forward to having it live on Minglar soon. +
+ +
+ Warm regards,
+ Team Minglar
+
Hi ${name},
+ +Your activity schedule has been officially approved.
+ ++ Everything is now in place. Your experience is fully configured and queued for launch. + Our team is completing the final activation before it goes live on Minglar. +
+ ++ You can continue managing your availability or adding new time slots anytime through your Host Portal: +
+ +
+ 👉 Host Portal
+ ${config.HOST_LINK}
+
+ This is a big step. We’re excited to bring your experience to life on Minglar. +
+ +
+ Warm regards,
+ The Minglar Team
+
Hi ${emailAddress},
-We're happy to invite you to join the Minglar team as an Account Manager.
-To get started, please set up your account using the link below:
- -If you have any questions or need help during the setup process, feel free to reach out.
-We look forward to working with you.
-Warm regards,
Minglar Team
Hi ${emailAddress},
+ ++ We’re happy to invite you to join the Minglar team as an Account Manager. +
+ ++ To get started, please set up your account using the link below: +
+ ++ ${link} +
+ ++ If you have any questions or need help during the setup process, feel free to reach out. +
+ ++ We look forward to working with you. +
+ +
+ Warm regards,
+ Minglar Team
+
Hi ${firstName},
-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.
-Host portal login:
- ${config.HOST_LINK}
-
We appreciate your interest in Minglar and look forward to reviewing your updated application.
-Warm regards,
Team Minglar
Hi ${firstName},
+ ++ 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. +
+ +
+ Host Portal Login
+ ${config.HOST_LINK}
+
+ We appreciate your interest in Minglar and look forward to reviewing your updated application. +
+ +
+ Warm regards,
+ Minglar Team
+
Hi ${name},
-Thank you for taking the time to submit your activity pre-qualification details on the Minglar platform.
-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.
-You can log in to the Host portal to review the feedback and continue updating your application:
- -If you need any guidance, feel free to reach out to us at info@minglargroup.com.
-We appreciate your interest in partnering with Minglar and look forward to reviewing your updated submission.
-Thank you,
Minglar Team
Hi ${name},
+ ++ Thank you for taking the time to submit your activity pre-qualification details on the Minglar platform. +
+ ++ 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. +
+ ++ You can log in to the Host portal to review the feedback and continue updating your application: +
+ +
+ Host Portal Login
+ ${config.HOST_LINK_PQ}
+
+ If you need any guidance, feel free to reach out to us at + info@minglargroup.com. +
+ ++ We appreciate your interest in partnering with Minglar and look forward to reviewing your updated submission. +
+ +
+ Thank you,
+ Minglar Team
+
Hi ${name},
-Thank you for submitting your activity for review.
-After evaluating the details provided, we're unable to approve the listing at this stage. A few updates are required before we can proceed.
-Please log in to your Host Portal to review the feedback and make the necessary revisions.
-Access your Host Portal:
- ${config.HOST_LINK}
-
Once the updates have been submitted, our team will re-evaluate your activity promptly.
-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.
-Warm regards,
The Minglar Team
Hi ${name},
+ ++ Thank you for submitting your activity for review. +
+ ++ After evaluating the details provided, we’re unable to approve the listing at this stage. A few updates are required before we can proceed. +
+ ++ Please log in to your Host Portal to review the feedback and make the necessary revisions. +
+ +
+ 👉 Access your Host Portal:
+ ${config.HOST_LINK}
+
+ Once the updates have been submitted, our team will re-evaluate your activity promptly. +
+ ++ 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. +
+ +
+ Warm regards,
+ The Minglar Team
+
Hi ${name},
+ +Thank you for submitting your activity schedule for review.
+ ++ At this stage, we’re unable to approve the schedule. Please log in to your Host Portal + to review the changes required and update the details accordingly. +
+ ++ 👉 ${config.HOST_LINK} +
+ ++ Once the revisions have been made, our team will promptly review the schedule again so + we can move you closer to going live on Minglar. +
+ ++ We’re looking forward to activating your experience soon. +
+ ++ The Minglar Team +
+`; + + try { + const result = await brevoService.sendEmail({ + recipients: [{ email: emailAddress }], + subject, + htmlContent, + }); + + console.log('📧 Email sent successfully:', result); + + return { + sent: true, + }; + } catch (err) { + console.error('Brevo email send failed:', err); + throw new ApiError(500, 'Failed to send schedule rejection email to host.'); + } +} +