feat: add optional plain-text fallback to sendEmail
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ export async function sendEmail(
|
||||
subject: string,
|
||||
html: string,
|
||||
from?: string,
|
||||
text?: string,
|
||||
): Promise<nodemailer.SentMessageInfo> {
|
||||
const transporter = createTransporter();
|
||||
|
||||
@@ -46,12 +47,10 @@ export async function sendEmail(
|
||||
to: Array.isArray(to) ? to.join(', ') : to,
|
||||
subject,
|
||||
html,
|
||||
...(text ? { text } : {}),
|
||||
});
|
||||
|
||||
logger.debug(
|
||||
{ messageId: info.messageId, to, subject },
|
||||
'Email sent',
|
||||
);
|
||||
logger.debug({ messageId: info.messageId, to, subject }, 'Email sent');
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user