aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
-rw-r--r--docs/customising/templates.md2
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm7
-rw-r--r--t/app/model/problem.t3
4 files changed, 12 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7650612cd..1f2f3ed3e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -53,6 +53,7 @@
- Allow cobrands to disable admin resending.
- Sass variables for default link colour and decoration.
- Make contact edit note optional on staging sites.
+ - Store email addresses report sent to on the report.
- Open311 improvements:
- Support use of 'private' service definition <keywords> to mark
reports made in that category private. #2488
diff --git a/docs/customising/templates.md b/docs/customising/templates.md
index 793156f70..303dd6f0d 100644
--- a/docs/customising/templates.md
+++ b/docs/customising/templates.md
@@ -109,5 +109,5 @@ and click the email you wish to preview.
To include an inline logo in your HTML email, put it at
`web/cobrands/yourcobrands/images/email-logo.gif` and make sure `logo_width`
and `logo_height` are set appropriately in your
-`_email_setting_overrides.html`. The email template should then pick it up
+`_email_color_overrides.html`. The email template should then pick it up
automatically.
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index 09847cf5f..5b0151595 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -110,6 +110,7 @@ sub send {
$params, $sender, $nomail, $cobrand, $row->lang);
unless ($result) {
+ $row->set_extra_metadata('sent_to' => email_list($params->{To}));
$self->success(1);
} else {
$self->error( 'Failed to send email' );
@@ -118,6 +119,12 @@ sub send {
return $result;
}
+sub email_list {
+ my $list = shift;
+ my @list = map { ref $_ ? $_->[0] : $_ } @$list;
+ return \@list;
+}
+
# SW&T has different contact addresses depending upon the old district
sub swandt_contact {
my $district = _get_district_for_contact(@_);
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index e973febc1..18557f44a 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -616,6 +616,8 @@ subtest 'check can set multiple emails as a single contact' => sub {
FixMyStreet::Script::Reports::send();
};
+ $problem->discard_changes;
+ is_deeply $problem->get_extra_metadata('sent_to'), [ '2636@example.com', '2636-2@example.com' ];
$mech->email_count_is(1);
my $email = $mech->get_email;
is $email->header('To'), '"City of Edinburgh Council" <2636@example.com>, "City of Edinburgh Council" <2636-2@example.com>', 'To contains two email addresses';
@@ -662,6 +664,7 @@ subtest 'check can turn on report sent email alerts' => sub {
$problem->discard_changes;
ok defined( $problem->whensent ), 'whensent set';
+ is_deeply $problem->get_extra_metadata('sent_to'), [ 'test@example.org' ];
$email = $emails[1];
like $email->header('Subject'), qr/FixMyStreet Report Sent/, 'report sent email title correct';