From acf6b253e1bb1bcf3a66aace0d6c1d61d8c4a111 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 23 Mar 2015 11:57:59 +1100 Subject: [PATCH] FEATURE: pick a valid hostname for notification email based on hostname FEATURE: allow notification email to be set via ENV --- config/site_settings.yml | 1 + db/fixtures/999_settings.rb | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 db/fixtures/999_settings.rb diff --git a/config/site_settings.yml b/config/site_settings.yml index a958214d720..d6f3a041c6d 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -31,6 +31,7 @@ required: notification_email: default: 'noreply@unconfigured.discourse.org' type: email + shadowed_by_global: true site_contact_username: default: '' type: username diff --git a/db/fixtures/999_settings.rb b/db/fixtures/999_settings.rb new file mode 100644 index 00000000000..d34d4687a27 --- /dev/null +++ b/db/fixtures/999_settings.rb @@ -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