From e3af10f9c2d29730993901339e89405b1dc770e9 Mon Sep 17 00:00:00 2001 From: Bruno Perel Date: Fri, 24 Jan 2025 22:28:17 +0100 Subject: [PATCH] api: Emails should always come from the admin address --- packages/api/emails/bookstore-suggested/index.ts | 2 +- packages/api/emails/edge-model-ready/index.ts | 2 +- packages/api/emails/edge-photo-sent/index.ts | 2 +- packages/api/emails/feedback-sent/index.ts | 2 +- packages/api/emails/presentation-sentence-requested/index.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/api/emails/bookstore-suggested/index.ts b/packages/api/emails/bookstore-suggested/index.ts index 3030121c..51e5f29f 100644 --- a/packages/api/emails/bookstore-suggested/index.ts +++ b/packages/api/emails/bookstore-suggested/index.ts @@ -14,7 +14,7 @@ export default class extends Email { getTo = () => process.env.SMTP_USERNAME!; getToName = () => process.env.SMTP_FRIENDLYNAME!; - getFrom = () => this.data.user?.email || "anonymous@duckmanager.net"; + getFrom = () => process.env.SMTP_USERNAME!; getFromName = () => this.data.user?.username || "Anonymous"; getSubject = () => "Bookstore suggestion"; } diff --git a/packages/api/emails/edge-model-ready/index.ts b/packages/api/emails/edge-model-ready/index.ts index e85fd646..89454079 100644 --- a/packages/api/emails/edge-model-ready/index.ts +++ b/packages/api/emails/edge-model-ready/index.ts @@ -21,7 +21,7 @@ export default class extends Email { }; } - getFrom = () => this.data.user.email!; + getFrom = () => process.env.SMTP_USERNAME!; getFromName = () => this.data.user.username; getTo = () => process.env.SMTP_USERNAME!; getToName = () => process.env.SMTP_FRIENDLYNAME!; diff --git a/packages/api/emails/edge-photo-sent/index.ts b/packages/api/emails/edge-photo-sent/index.ts index 625f39d5..318f827d 100644 --- a/packages/api/emails/edge-photo-sent/index.ts +++ b/packages/api/emails/edge-photo-sent/index.ts @@ -21,7 +21,7 @@ export default class extends Email { }; } - getFrom = () => this.data.user.email!; + getFrom = () => process.env.SMTP_USERNAME!; getFromName = () => this.data.user.username; getTo = () => process.env.SMTP_USERNAME!; getToName = () => process.env.SMTP_FRIENDLYNAME!; diff --git a/packages/api/emails/feedback-sent/index.ts b/packages/api/emails/feedback-sent/index.ts index dfa7c46c..cbe32c65 100644 --- a/packages/api/emails/feedback-sent/index.ts +++ b/packages/api/emails/feedback-sent/index.ts @@ -18,7 +18,7 @@ export default class extends Email { getTo = () => process.env.SMTP_USERNAME!; getToName = () => process.env.SMTP_FRIENDLYNAME!; - getFrom = () => this.data.user?.email || "anonymous@duckmanager.net"; + getFrom = () => process.env.SMTP_USERNAME!; getFromName = () => this.data.user?.username || "Anonymous"; getSubject = () => i18n.__("User {{username}} sent a feedback", { diff --git a/packages/api/emails/presentation-sentence-requested/index.ts b/packages/api/emails/presentation-sentence-requested/index.ts index 628b1b85..1f082160 100644 --- a/packages/api/emails/presentation-sentence-requested/index.ts +++ b/packages/api/emails/presentation-sentence-requested/index.ts @@ -13,7 +13,7 @@ export default class extends Email { this.data = data; } - getFrom = () => this.data.user.email!; + getFrom = () => process.env.SMTP_USERNAME!; getFromName = () => this.data.user.username!; getTo = () => process.env.SMTP_USERNAME!; getToName = () => process.env.SMTP_FRIENDLYNAME!;