From 23cbcda0c3fdb885b30ebe38819cfd73be51b6ac Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 18 Jul 2018 14:40:46 +0100 Subject: [PATCH] Allow preferred_mails_from and preferred_mail_bcc to be set from configs --- config/application.yml.example | 4 ++++ db/seeds.rb | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/application.yml.example b/config/application.yml.example index 03b33f9f11..266fe6b41e 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -29,6 +29,10 @@ MAIL_PORT: 25 SMTP_USERNAME: 'ofn' SMTP_PASSWORD: 'f00d' +# Optional mail settings +# MAILS_FROM: hello@example.com +# MAIL_BCC: manager@example.com + # SingleSignOn login for Discourse # # DISCOURSE_SSO_SECRET should be a random string. It must be the same as provided to your Discourse instance. diff --git a/db/seeds.rb b/db/seeds.rb index d54987f68f..e20112c710 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -43,8 +43,8 @@ def create_mail_method preferred_smtp_username: ENV.fetch('SMTP_USERNAME'), preferred_smtp_password: ENV.fetch('SMTP_PASSWORD'), preferred_secure_connection_type: 'None', - preferred_mails_from: "no-reply@#{ENV.fetch('MAIL_DOMAIN')}", - preferred_mail_bcc: '', + preferred_mails_from: ENV.fetch('MAILS_FROM', "no-reply@#{ENV.fetch('MAIL_DOMAIN')}"), + preferred_mail_bcc: ENV.fetch('MAIL_BCC', ''), preferred_intercept_email: '' ).call end