diff options
-rw-r--r-- | conf/general.yml-example | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Problem.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/conf/general.yml-example b/conf/general.yml-example index 4fbf43635..175b342a4 100644 --- a/conf/general.yml-example +++ b/conf/general.yml-example @@ -23,8 +23,14 @@ EMAIL_DOMAIN: 'example.org' CONTACT_EMAIL: 'team@example.org' CONTACT_NAME: 'FixMyStreet' -# Whether this is a development site or not. +# Whether this is a development site or not. It will mean e.g. templates/ +# CSS modified times aren't cached STAGING_SITE: 1 +# Normally, a staging site will route all reports to CONTACT_EMAIL on a +# development site (when STAGING_SITE is 1), to guard against sending fake +# reports to live places. Set this to 1 if you want a dev site to route +# reports as normal. +SEND_REPORTS_ON_STAGING: 0 # What to use as front page/alert example places placeholder # Defaults to High Street, Main Street diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm index 897a7e732..8bf0fc93a 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm @@ -360,7 +360,7 @@ sub send_reports { next unless $sender_count; - if (mySociety::Config::get('STAGING_SITE')) { + if (mySociety::Config::get('STAGING_SITE') && !mySociety::Config::get('SEND_REPORTS_ON_STAGING')) { # on a staging server send emails to ourselves rather than the bodies my @testing_bodies = split( '\|', mySociety::Config::get('TESTING_COUNCILS') ); unless ( grep { $row->bodies_str eq $_ } @testing_bodies ) { diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 2a580c0d5..182c47d56 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -67,7 +67,7 @@ sub send { my @recips = $self->build_recipient_list( $row, $h ); # on a staging server send emails to ourselves rather than the bodies - if (mySociety::Config::get('STAGING_SITE') && !FixMyStreet->test_mode) { + if (mySociety::Config::get('STAGING_SITE') && !mySociety::Config::get('SEND_REPORTS_ON_STAGING') && !FixMyStreet->test_mode) { @recips = ( mySociety::Config::get('CONTACT_EMAIL') ); } |