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:
2026-04-14 12:54:25 -04:00
parent ae19170da8
commit 44982a2878

View File

@@ -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;
}