IO-3386 CARFAX RPS

Add Brad Rhoades to Report

Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
Allan Carr
2025-10-03 11:24:10 -07:00
parent 678a87f55d
commit 4899297539
3 changed files with 28 additions and 17 deletions

View File

@@ -44,8 +44,14 @@ const logEmail = async (req, email) => {
}
};
const sendServerEmail = async ({ subject, text }) => {
const sendServerEmail = async ({ subject, text, to = [] }) => {
if (process.env.NODE_ENV === undefined) return;
let sentTo = ["support@imexsystems.ca"];
if (to?.length) {
sentTo = [...sentTo, ...to];
}
try {
mailer.sendMail(
{
@@ -53,7 +59,7 @@ const sendServerEmail = async ({ subject, text }) => {
imex: `ImEX Online API - ${process.env.NODE_ENV} <noreply@imex.online>`,
rome: `Rome Online API - ${process.env.NODE_ENV} <noreply@romeonline.io>`
}),
to: ["support@thinkimex.com"],
to: sentTo,
subject: subject,
text: text,
ses: {
@@ -258,7 +264,10 @@ const sendTaskEmail = async ({ to, subject, type = "text", html, text, attachmen
// eslint-disable-next-line no-unused-vars
(err, info) => {
// (message, type, user, record, meta
logger.log("server-email-send", err ? "error" : "debug", null, null, { message: err?.message, stack: err?.stack });
logger.log("server-email-send", err ? "error" : "debug", null, null, {
message: err?.message,
stack: err?.stack
});
}
);
} catch (error) {