Minor release fixes.

This commit is contained in:
Patrick Fic
2022-08-26 13:59:44 -07:00
parent 79563a5cba
commit f5c9a7dfef
3 changed files with 40 additions and 13 deletions

View File

@@ -180,15 +180,25 @@ async function getImage(imageUrl) {
}
async function logEmail(req, email) {
await client.request(queries.INSERT_EMAIL_AUDIT, {
email: {
to: email.to,
cc: email.cc,
subject: email.subject,
bodyshopid: req.body.bodyshopid,
useremail: req.user.email,
contents: req.body.html,
jobid: req.body.jobid,
},
});
try {
await client.request(queries.INSERT_EMAIL_AUDIT, {
email: {
to: email.to,
cc: email.cc,
subject: email.subject,
bodyshopid: req.body.bodyshopid,
useremail: req.user.email,
contents: req.body.html,
jobid: req.body.jobid,
},
});
} catch (error) {
logger.log("email-log-error", "error", req.user.email, null, {
from: `${req.body.from.name} <${req.body.from.address}>`,
to: req.body.to,
cc: req.body.cc,
subject: req.body.subject,
// info,
});
}
}