Add fromName field support to emails collection

- Add fromName field to Emails collection schema for sender display name
- Update BaseEmailDocument and QueuedEmail interfaces to include fromName
- Add SendEmailTaskInput support for fromName field in job tasks
- Update MailingService to combine fromName and from into proper "Name <email>" format
- Add fromName, from, and replyTo fields to job input schema for admin UI
- Update field copying logic to handle new sender-related fields

Users can now specify a display name for emails (e.g., "John Doe <john@example.com>").

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-14 00:03:04 +02:00
parent 20afe30e88
commit e20ebe27bf
5 changed files with 46 additions and 97 deletions

View File

@@ -238,8 +238,16 @@ export class MailingService implements IMailingService {
id: emailId,
}) as BaseEmailDocument
// Combine from and fromName for nodemailer
let fromField = email.from
if (email.fromName && email.from) {
fromField = `"${email.fromName}" <${email.from}>`
} else if (email.from) {
fromField = email.from
}
const mailOptions = {
from: email.from,
from: fromField,
to: email.to,
cc: email.cc || undefined,
bcc: email.bcc || undefined,