FEATURE: pick a valid hostname for notification email based on hostname

FEATURE: allow notification email to be set via ENV
This commit is contained in:
Sam 2015-03-23 11:57:59 +11:00
parent 853c91d7d0
commit acf6b253e1
2 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,7 @@ required:
notification_email: notification_email:
default: 'noreply@unconfigured.discourse.org' default: 'noreply@unconfigured.discourse.org'
type: email type: email
shadowed_by_global: true
site_contact_username: site_contact_username:
default: '' default: ''
type: username type: username

View File

@ -0,0 +1,4 @@
if SiteSetting.notification_email == SiteSetting.defaults[:notification_email]
# don't crash for invalid hostname, which is possible in dev
SiteSetting.notification_email = "noreply@#{Discourse.current_hostname}" rescue nil
end