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, subject: string,
html: string, html: string,
from?: string, from?: string,
text?: string,
): Promise<nodemailer.SentMessageInfo> { ): Promise<nodemailer.SentMessageInfo> {
const transporter = createTransporter(); const transporter = createTransporter();
@@ -46,12 +47,10 @@ export async function sendEmail(
to: Array.isArray(to) ? to.join(', ') : to, to: Array.isArray(to) ? to.join(', ') : to,
subject, subject,
html, html,
...(text ? { text } : {}),
}); });
logger.debug( logger.debug({ messageId: info.messageId, to, subject }, 'Email sent');
{ messageId: info.messageId, to, subject },
'Email sent',
);
return info; return info;
} }