diff --git a/app/models/admin_dashboard_data.rb b/app/models/admin_dashboard_data.rb index 5bd181b63..a4caf42bc 100644 --- a/app/models/admin_dashboard_data.rb +++ b/app/models/admin_dashboard_data.rb @@ -49,7 +49,8 @@ class AdminDashboardData twitter_config_check, github_config_check, failing_emails_check, - default_logo_check ].compact + default_logo_check, + contact_email_check ].compact end def rails_env_check @@ -106,4 +107,9 @@ class AdminDashboardData I18n.t('dashboard.default_logo_warning') end end + + def contact_email_check + return I18n.t('dashboard.contact_email_missing') if !SiteSetting.contact_email.present? + return I18n.t('dashboard.contact_email_invalid') if !(SiteSetting.contact_email =~ User::EMAIL) + end end \ No newline at end of file diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index 831458250..1e94e265c 100755 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -12,6 +12,7 @@ class SiteSetting < ActiveRecord::Base client_setting(:title, "Discourse") client_setting(:logo_url, '/assets/d-logo-sketch.png') client_setting(:logo_small_url, '/assets/d-logo-sketch-small.png') + setting(:contact_email, '') setting(:company_full_name, 'My Unconfigured Forum Ltd.') setting(:company_short_name, 'Unconfigured Forum') setting(:company_domain, 'www.example.com') diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index ad61dfbee..cf04b78f3 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -348,6 +348,8 @@ en: github_config_warning: 'The server is configured to allow signup and log in with GitHub (enable_github_logins), but the client id and secret values are not set. Go to the Site Settings and update the settings. See this guide to learn more.' failing_emails_warning: "There are %{num_failed_jobs} email jobs that failed. Check your config/production.rb file and ensure that the config.action_mailer settings are correct." default_logo_warning: "You haven't customized the logo images for your site. Update logo_url, logo_small_url, and favicon_url in the Site Settings." + contact_email_missing: "You haven't provided a contact email for your site. Please update contact_email in the Site Settings." + contact_email_invalid: "The site contact email is invalid. Please update contact_email in the Site Settings." content_types: education_new_reply: @@ -385,6 +387,7 @@ en: discourse_org_access_key: "The access key used to access the Discourse Hub nickname registry at discourse.org" educate_until_posts: "Show pop-up composer education panel until the user has made this many posts" title: "Title of this site, will be used in the title tag and elsewhere" + contact_email: "The email address of someone who can be contacted about the site. Important notices from Discourse.org regarding critical updates will be sent to this address." company_full_name: "The full name of the company that runs this site, used in legal documents like the /tos" company_short_name: "The short name of the company that runs this site, used in legal documents like the /tos" company_domain: "The domain name owned by the company that runs this site, used in legal documents like the /tos"