Allow preferred_mails_from and preferred_mail_bcc to be set from configs

This commit is contained in:
Matt-Yorkley
2018-07-18 14:40:46 +01:00
parent 0fd57ee7bd
commit 23cbcda0c3
2 changed files with 6 additions and 2 deletions

View File

@@ -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.

View File

@@ -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