New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow emails to be turned off per deployment #720
Conversation
Please rebase this branch to our updated master. We just incorporated a lot of new changes into our current master branch. Fix the conflicts accordingly. |
@@ -51,8 +51,7 @@ def notification_received(user, ssr) | |||
private | |||
|
|||
def send_message subject, is_service_provider='false', ssr_id='' | |||
email = Rails.env == 'production' ? @send_to.email : DEFAULT_MAIL_TO | |||
subject = Rails.env == 'production' ? subject : "[#{Rails.env.capitalize} - EMAIL TO #{@send_to.email}] #{subject}" | |||
email = @send_to.email |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subject is missing here now. Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes intentional, subject is passed straight through to mail.
Otherwise it would have been subject = subject
I think
aa3b4a0
to
8e07b0b
Compare
Rebase completed. Please see also the lines I've marked with ##Review they didn't look correct in the original code to me. |
Hey Chris. Can you look into the test failures? We'll get it merged in as soon as it's passing on Travis. |
dec1cf8
to
a076fb1
Compare
a076fb1
to
99d3200
Compare
We needed to be able to disable sending of emails to real users in our test and staging environments, but relying on a check for the Rails environment is problematic and was duplicated in several places in the code.
This change removes the duplication and contains the logic in a single place. It also moves the setting to application.yml.
This setting is intentionally off by default so that someone couldn't accidentally deploy to testing and have it start sending emails on them.
I created this branch based on the release-1.8.0 tag thinking that it would then not pick up any changes that were not ready to be released. But it looks like the tags get created off musc_production but musc_production has stuff that's not in master?