aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2018-02-08 15:48:36 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-02-12 14:05:08 +0000
commit27027ad882f5e1ddb8f2445e3b63972524ba82aa (patch)
tree386ffcb0b45e0538de608a6c80636a61024b90e2
parentfd97c61fcfea0c6f9dd3746b34048e9ddf27c4dd (diff)
Improvements to report_sent_confirmation_email function
- Send ‘report sent’ emails from cobrand’s contact address - Don’t send email when report is made using contribute-as-other and report_sent_confirmation_email is active.
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm9
-rw-r--r--perllib/FixMyStreet/Script/Reports.pm4
2 files changed, 7 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index eff45013f..f9e07dd41 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1398,10 +1398,11 @@ sub redirect_or_confirm_creation : Private {
if ( $report->confirmed ) {
# Subscribe problem reporter to email updates
$c->forward( 'create_reporter_alert' );
- if ($c->stash->{contributing_as_another_user} && $report->user->email) {
- $c->send_email( 'other-reported.txt', {
- to => [ [ $report->user->email, $report->name ] ],
- } );
+ if ($c->stash->{contributing_as_another_user} && $report->user->email
+ && !$c->cobrand->report_sent_confirmation_email) {
+ $c->send_email( 'other-reported.txt', {
+ to => [ [ $report->user->email, $report->name ] ],
+ } );
}
# If the user has shortlist permission, and either we're not on a
# council cobrand or the just-created problem is owned by the cobrand
diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm
index d6a614651..8e4a4aec1 100644
--- a/perllib/FixMyStreet/Script/Reports.pm
+++ b/perllib/FixMyStreet/Script/Reports.pm
@@ -306,9 +306,9 @@ sub _send_report_sent_email {
$h,
{
To => $row->user->email,
- From => [ FixMyStreet->config('CONTACT_EMAIL'), $cobrand->contact_name ],
+ From => [ $cobrand->contact_email, $cobrand->contact_name ],
},
- FixMyStreet->config('CONTACT_EMAIL'),
+ $cobrand->contact_email,
$nomail,
$cobrand,
$row->lang,