feature/IO-2979-DST-Handling

- Checkpoint

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-10-10 13:01:36 -04:00
parent 2bf074d85a
commit 5a90854861
5 changed files with 64 additions and 20 deletions

View File

@@ -28,22 +28,4 @@ let transporter = nodemailer.createTransport({
SES: { ses, aws }
});
if (isLocal) {
// Wrap the sendMail function to log the email contents to the console in local environment
const originalSendMail = transporter.sendMail.bind(transporter);
transporter.sendMail = async (mailOptions) => {
try {
const result = await originalSendMail(mailOptions);
console.log(
`Email sent successfully - From: ${result?.envelope?.from} - To: ${result?.envelope?.to} - MessageID ${result.messageId} - Check LocalStack to see message`
);
return result;
} catch (error) {
console.error("Failed to send email:", error);
throw error;
}
};
}
module.exports = transporter;