fix(mail): show "PawFeed Team" as sender name instead of "team" (Gitea #20)

MAIL_FROM is a bare address with no display name, so mail clients fell
back to showing the local-part as the sender. Wrap it in a proper
display name in code instead of depending on env var formatting.
This commit is contained in:
admin committed 2026-08-13 14:15:37 +02:00
1 parent 092268b8e7
commit f0a878c432
1 file changed
+5 -1
+5 -1
View File
@@ -43,6 +43,10 @@ interface SendMailInput {
}
export async function sendMail({ to, subject, text, html }: SendMailInput): Promise<void> {
const from = process.env.MAIL_FROM ?? process.env.SMTP_USER;
const fromAddress = process.env.MAIL_FROM ?? process.env.SMTP_USER;
// Wrap in a display name — a bare address (e.g. "team@pawfeed.org") makes
// most mail clients fall back to showing the local-part ("team") as the
// sender name instead of something recognizable (Gitea #20).
const from = `"PawFeed Team" <${fromAddress}>`;
await getTransporter().sendMail({ from, to, subject, text, html });
}