IO-3330 CARFAX Datapump Adjustment

Cron trigger and billing email

Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
Allan Carr
2025-09-17 14:43:07 -07:00
parent 4afff893c0
commit 038aa82087
4 changed files with 81 additions and 1 deletions

View File

@@ -79,6 +79,41 @@ const sendServerEmail = async ({ subject, text }) => {
}
};
const sendMexicoBillingEmail = async ({ subject, text }) => {
if (process.env.NODE_ENV === undefined) return;
try {
mailer.sendMail(
{
from: InstanceManager({
imex: `ImEX Online API - ${process.env.NODE_ENV} <noreply@imex.online>`,
rome: `Rome Online API - ${process.env.NODE_ENV} <noreply@romeonline.io>`
}),
to: ["mexico@rometech.zohodesk.com"],
subject: subject,
text: text,
ses: {
// optional extra arguments for SendRawEmail
Tags: [
{
Name: "tag_name",
Value: "tag_value"
}
]
}
},
// eslint-disable-next-line no-unused-vars
(err, info) => {
logger.log("server-email-failure", err ? "error" : "debug", null, null, {
message: err?.message,
stack: err?.stack
});
}
);
} catch (error) {
logger.log("server-email-failure", "error", null, null, { message: error?.message, stack: error?.stack });
}
};
const sendWelcomeEmail = async ({ to, resetLink, dateLine, features, bcc }) => {
try {
await mailer.sendMail({
@@ -420,6 +455,7 @@ ${body.bounce?.bouncedRecipients.map(
module.exports = {
sendEmail,
sendServerEmail,
sendMexicoBillingEmail,
sendTaskEmail,
emailBounce,
sendWelcomeEmail