Merged in hotfix/IO-3148-Error-In-Email-Bounce-Route (pull request #2121)
hotfix/IO-3148-Error-In-Email-Bounce-Route: Hot Fix for Broken Import
This commit is contained in:
@@ -92,7 +92,7 @@ const sendTaskEmail = async ({ to, subject, type = "text", html, text, attachmen
|
||||
},
|
||||
(err, info) => {
|
||||
// (message, type, user, record, meta
|
||||
logger.log("server-email", err ? "error" : "debug", null, null, { message: err || info });
|
||||
logger.log("server-email", err ? "error" : "debug", null, null, { message: err ? err?.message : info });
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
@@ -239,24 +239,24 @@ const emailBounce = async (req, res) => {
|
||||
return;
|
||||
}
|
||||
//If it's bounced, log it as bounced in audit log. Send an email to the user.
|
||||
const result = await client.request(queries.UPDATE_EMAIL_AUDIT, {
|
||||
await client.request(queries.UPDATE_EMAIL_AUDIT, {
|
||||
sesid: messageId,
|
||||
status: "Bounced",
|
||||
context: message.bounce?.bouncedRecipients
|
||||
});
|
||||
mailer.sendMail(
|
||||
{
|
||||
from: InstanceMgr({
|
||||
from: InstanceManager({
|
||||
imex: `ImEX Online <noreply@imex.online>`,
|
||||
rome: `Rome Online <noreply@romeonline.io>`
|
||||
}),
|
||||
to: replyTo,
|
||||
//bcc: "patrick@snapt.ca",
|
||||
subject: `${InstanceMgr({
|
||||
subject: `${InstanceManager({
|
||||
imex: "ImEX Online",
|
||||
rome: "Rome Online"
|
||||
})} Bounced Email - RE: ${subject}`,
|
||||
text: `${InstanceMgr({
|
||||
text: `${InstanceManager({
|
||||
imex: "ImEX Online",
|
||||
rome: "Rome Online"
|
||||
})} has tried to deliver an email with the subject: ${subject} to the intended recipients but encountered an error.
|
||||
@@ -270,7 +270,7 @@ ${body.bounce?.bouncedRecipients.map(
|
||||
},
|
||||
(err, info) => {
|
||||
logger.log("sns-error", err ? "error" : "debug", "api", null, {
|
||||
message: err ? JSON.stringify(error) : info
|
||||
message: err ? err?.message : info
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user