Skip to content

Commit

Permalink
fix(emails): Better setting default sender address using `GCLOUD_PROJ…
Browse files Browse the repository at this point in the history
…ECT` if any

May follow store name, better than generic (fallback) lojas@e-com.plus

Stick with validated e-com.plus domain name by default
  • Loading branch information
leomp12 committed May 7, 2024
1 parent 865d8f6 commit 32b5a66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/emails/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const sendEmail = (
SMTP_USER,
SMTP_PASS,
SMTP_TLS,
GCLOUD_PROJECT,
SENDGRID_API_KEY,
} = process.env;
const { settingsContent } = config.get();
Expand All @@ -65,7 +66,8 @@ const sendEmail = (
bcc,
from: {
name: MAIL_SENDER_NAME || settingsContent.name,
email: MAIL_SENDER || 'lojas@e-com.plus',
email: MAIL_SENDER
|| `${(GCLOUD_PROJECT?.replace('ecom2', '') || 'lojas')}@e-com.plus`,
},
replyTo: {
name: settingsContent.name,
Expand Down

0 comments on commit 32b5a66

Please sign in to comment.