psu-libraries / scholarsphere-3

A web application for ingest, curation, search, and display of digital assets. Powered by Hydra technologies (Rails, Hydra-head, Blacklight, Solr, Fedora Commons, etc.)
Apache License 2.0
78 stars 24 forks source link

User stats emails should not be sent on system other than prod #1614

Closed awead closed 4 years ago

awead commented 5 years ago

Stage and QA likely have the same cron jobs as prod, which means they will send out emails on the same date as prod. We should not do this.

awead commented 5 years ago

TODO:

whereismyjetpack commented 5 years ago

what we usually do is have a global bit that turns off the mailer, or use something like mailcatcher

are we setting email on / off in the rails config someplace?

awead commented 5 years ago

@whereismyjetpack No, mailler is on. I'm thinking we need to have another ENV key in application.yml that indicates what "environment" it is: qa, stage, prod, etc. But "environment" doesn't seem to be the right word.

whereismyjetpack commented 5 years ago

I'm usually more a fan of explicit config bits, instead of guessing based off env (this seems to be a rails anitpattern though)

i.e

mailer:
  enabled: true

in application.yml

whereismyjetpack commented 5 years ago

there may also be a case where we want to sent the smtp server to something like mail catcher to get a view on what it would have done?

awead commented 5 years ago

The mailer still needs to be enabled so we can test things. We can just turn off the job under config/schedule.rb:31.