diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-09-28 14:02:29 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-09-28 14:02:29 +0100 |
commit | 7f2b70f09e3e3d8395e0f36fe82e8632b4a9d423 (patch) | |
tree | 98de2a8f73d20bc3c04ea959ca13f67b81ceccd9 /app/models | |
parent | 74b82e10ba38366a615acd8402dcb5c4e2cb4756 (diff) | |
parent | dff4c6c0ef55a28e303d1e767f92545cb2ad0214 (diff) |
Merge remote-tracking branch 'openaustralia/redirect_email_for_testing' into develop
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/public_body.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 2cf1ce8a2..841e1e881 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -509,6 +509,20 @@ class PublicBody < ActiveRecord::Base return self.request_email_domain end + # Returns nil if configuration variable not set + def override_request_email + e = MySociety::Config.get("OVERRIDE_ALL_PUBLIC_BODY_REQUEST_EMAILS", "") + e if e != "" + end + + def request_email + if override_request_email + override_request_email + else + read_attribute(:request_email) + end + end + # Domain name of the request email def request_email_domain return PublicBody.extract_domain_from_email(self.request_email) |