diff --git a/config/application.yml.example b/config/application.yml.example index a75a3b3015..27dafdd5e9 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -16,6 +16,12 @@ CHECKOUT_ZONE: Australia # Find currency codes at http://en.wikipedia.org/wiki/ISO_4217. CURRENCY: AUD +# The whenever gem can set the `MAILTO` variable for our cron jobs. +# You can define an email address to notify if any job outputs something. +# But you need a working mail server setup so that the message is delivered. +# See: config/schedule.rb +#SCHEDULE_NOTIFICATIONS: admin@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/config/schedule.rb b/config/schedule.rb index acc39d2701..0a868df405 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -2,8 +2,9 @@ require 'whenever' # Learn more: http://github.com/javan/whenever -env "MAILTO", "rohan@rohanmitchell.com" +app_config = YAML.load_file(File.join(__dir__, 'application.yml')) +env "MAILTO", app_config["SCHEDULE_NOTIFICATIONS"] if app_config["SCHEDULE_NOTIFICATIONS"] # If we use -e with a file containing specs, rspec interprets it and filters out our examples job_type :run_file, "cd :path; :environment_variable=:environment bundle exec script/rails runner :task :output"