Fix email formatting: convert newlines to <br> for FreeScout HTML body

This commit is contained in:
Hoid 2026-02-17 22:19:03 +00:00
parent 3763fc0b15
commit e92f1f89a8

View file

@ -123,10 +123,12 @@ async function cmdReply(args) {
process.exit(1); process.exit(1);
} }
// FreeScout body field is HTML — convert plain text newlines to <br> tags
const htmlBody = message.replace(/\n/g, '<br>\n');
const body = { const body = {
type: draft ? 'note' : 'message', type: draft ? 'note' : 'message',
text: message, text: message,
body: message, body: htmlBody,
user: 6, user: 6,
status: status || (draft ? undefined : 'active'), status: status || (draft ? undefined : 'active'),
}; };