aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM Somerville <matthew-github@dracos.co.uk>2020-10-12 13:26:42 +0100
committerM Somerville <matthew-github@dracos.co.uk>2020-10-12 13:27:09 +0100
commit470d978db885e3ff95e7a8632a94a60b09cef127 (patch)
tree22530a978f5d30807c05828354e37b66d4bd8d4a
parentc778cff750282e814820b2f8ffee5e5c909e269a (diff)
Include extra fields in submit emails.
-rw-r--r--CHANGELOG.md1
-rw-r--r--perllib/FixMyStreet/Cobrand/Bexley.pm3
-rw-r--r--templates/email/default/submit.html8
-rw-r--r--templates/email/default/submit.txt5
-rw-r--r--templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html2
-rw-r--r--templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt2
-rw-r--r--templates/email/fixmystreet.com/submit.html11
-rw-r--r--templates/email/fixmystreet.com/submit.txt5
-rw-r--r--templates/email/hounslow/submit.html3
-rw-r--r--templates/email/hounslow/submit.txt2
-rw-r--r--templates/email/oxfordshire/submit.html3
-rw-r--r--templates/email/oxfordshire/submit.txt2
-rw-r--r--templates/email/tfl/submit.html3
-rw-r--r--templates/email/tfl/submit.txt2
14 files changed, 26 insertions, 26 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2914f303..70dd5771d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -49,6 +49,7 @@
- Response templates can include HTML tags. #3143
- Record whether report made on desktop or mobile.
- Do not display deleted priorities in inspect form. #3195
+ - Include extra fields in submit emails.
- Development improvements:
- `#geolocate_link` is now easier to re-style. #3006
- Links inside `#front-main` can be customised using `$primary_link_*` Sass variables. #3007
diff --git a/perllib/FixMyStreet/Cobrand/Bexley.pm b/perllib/FixMyStreet/Cobrand/Bexley.pm
index 2c05439be..063a225b7 100644
--- a/perllib/FixMyStreet/Cobrand/Bexley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bexley.pm
@@ -198,9 +198,6 @@ sub open311_post_send {
$self->open311_config($row, $h, {}, $contact); # Populate NSGRef again if needed
- my $extra_data = join "; ", map { "$_->{description}: $_->{value}" } @{$row->get_extra_fields};
- $h->{additional_information} = $extra_data;
-
$sender->send($row, $h);
}
diff --git a/templates/email/default/submit.html b/templates/email/default/submit.html
index 0fed5770f..e08a31b5a 100644
--- a/templates/email/default/submit.html
+++ b/templates/email/default/submit.html
@@ -49,6 +49,14 @@ of a local problem that they believe might require your attention.</p>
<h2 style="[% h2_style %]">[% report.title | html %]</h2>
<p style="[% secondary_p_style %]">[% report.category | html %]</p>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
+ [% IF report.get_extra_fields %]
+ <p style="[% secondary_p_style %]">
+ [%~ FOR field IN report.get_extra_fields %][% IF field.value %]
+ [% field.description %]: [% field.value %]
+ [% IF NOT loop.last %]<br>[% END %]
+ [%~ END %][% END %]
+ </p>
+ [% END %]
<p style="[% secondary_p_style %]">
<strong>Location:</strong>
<a href="[% osm_url %]" title="View OpenStreetMap of this location">
diff --git a/templates/email/default/submit.txt b/templates/email/default/submit.txt
index f08e723a8..b380825e4 100644
--- a/templates/email/default/submit.txt
+++ b/templates/email/default/submit.txt
@@ -25,6 +25,11 @@ Subject: [% report.title %]
Details: [% report.detail %]
+[% FOR field IN report.get_extra_fields %][% IF field.value ~%]
+[% field.description %]: [% field.value %]
+
+[% END %][% END ~%]
+
Latitude: [% report.latitude %]
Longitude: [% report.longitude %]
diff --git a/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html
index 8af8ea1b0..61aa9af34 100644
--- a/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html
+++ b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html
@@ -48,8 +48,6 @@
<td>[% url %]</td>
</tr>
</table>
-[% additional_information %]
-
<h2>Location Details</h2>
diff --git a/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt
index a860c0a34..20a2aeb4f 100644
--- a/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt
+++ b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt
@@ -24,8 +24,6 @@ Title: [% title %]
Description: [% detail %]
-[% additional_information %]
-
[% url %]
Location Details
diff --git a/templates/email/fixmystreet.com/submit.html b/templates/email/fixmystreet.com/submit.html
index f8b2db0dc..1d40f1eb6 100644
--- a/templates/email/fixmystreet.com/submit.html
+++ b/templates/email/fixmystreet.com/submit.html
@@ -49,9 +49,14 @@ of a local problem that they believe might require your attention.</p>
<h2 style="[% h2_style %]">[% report.title | html %]</h2>
<p style="[% secondary_p_style %]"><strong>Category:</strong> [% report.category | html %]</p>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [%~ IF additional_information %]
- <p style="[% secondary_p_style %]">[% additional_information %]</p>
- [%~ END %]
+ [% IF report.get_extra_fields %]
+ <p style="[% secondary_p_style %]">
+ [%~ FOR field IN report.get_extra_fields %][% IF field.value %]
+ [% field.description %]: [% field.value %]
+ [% IF NOT loop.last %]<br>[% END %]
+ [%~ END %][% END %]
+ </p>
+ [% END %]
<p style="[% secondary_p_style %]">
<strong>Location:</strong>
<br>Easting/Northing
diff --git a/templates/email/fixmystreet.com/submit.txt b/templates/email/fixmystreet.com/submit.txt
index c22d83713..3b3c0980f 100644
--- a/templates/email/fixmystreet.com/submit.txt
+++ b/templates/email/fixmystreet.com/submit.txt
@@ -25,7 +25,10 @@ Subject: [% report.title %]
Details: [% report.detail %]
-[% additional_information %]
+[% FOR field IN report.get_extra_fields %][% IF field.value ~%]
+[% field.description %]: [% field.value %]
+
+[% END %][% END ~%]
Easting/Northing
[%- " (IE)" IF coordsyst == "I" -%]
diff --git a/templates/email/hounslow/submit.html b/templates/email/hounslow/submit.html
index 5b9f2e255..a22f15243 100644
--- a/templates/email/hounslow/submit.html
+++ b/templates/email/hounslow/submit.html
@@ -52,9 +52,6 @@ of a local problem that they believe might require your attention.</p>
[% END %]
<p style="[% secondary_p_style %]"><strong>Category:</strong> [% report.category | html %]</p>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [%~ IF additional_information %]
- <p style="[% secondary_p_style %]">[% additional_information %]</p>
- [%~ END %]
<p style="[% secondary_p_style %]">
<strong>Location:</strong>
<br>Easting/Northing
diff --git a/templates/email/hounslow/submit.txt b/templates/email/hounslow/submit.txt
index 3d9518e53..bbf23326b 100644
--- a/templates/email/hounslow/submit.txt
+++ b/templates/email/hounslow/submit.txt
@@ -25,8 +25,6 @@ Subject: [% report.title %]
Details: [% report.detail %]
-[% additional_information %]
-
Easting/Northing
[%- " (IE)" IF coordsyst == "I" -%]
: [% easting %]/[% northing %]
diff --git a/templates/email/oxfordshire/submit.html b/templates/email/oxfordshire/submit.html
index d26f3d44e..428436523 100644
--- a/templates/email/oxfordshire/submit.html
+++ b/templates/email/oxfordshire/submit.html
@@ -49,9 +49,6 @@ of a local problem that they believe might require your attention.</p>
<h2 style="[% h2_style %]">[% report.title | html %]</h2>
<p style="[% secondary_p_style %]"><strong>Category:</strong> [% report.category | html %]</p>
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [%~ IF additional_information %]
- <p style="[% secondary_p_style %]">[% additional_information %]</p>
- [%~ END %]
<p style="[% secondary_p_style %]">
<strong>Location:</strong>
<br>Easting/Northing
diff --git a/templates/email/oxfordshire/submit.txt b/templates/email/oxfordshire/submit.txt
index 90de2e60c..faa39e2b4 100644
--- a/templates/email/oxfordshire/submit.txt
+++ b/templates/email/oxfordshire/submit.txt
@@ -25,8 +25,6 @@ Subject: [% report.title %]
Details: [% report.detail %]
-[% additional_information %]
-
[%- IF report.get_extra_field_value('feature_id') %]
Asset id: [% report.get_extra_field_value('feature_id') %]
[%- END %]
diff --git a/templates/email/tfl/submit.html b/templates/email/tfl/submit.html
index a1bd8f134..2bce514d0 100644
--- a/templates/email/tfl/submit.html
+++ b/templates/email/tfl/submit.html
@@ -58,9 +58,6 @@ of a local problem that they believe might require your attention.</p>
<p style="[% secondary_p_style %]"><strong>Signal site number:</strong> [% report.get_extra_field_value('site') | html %]</p>
[% END %]
<p style="[% secondary_p_style %]">[% report.detail | html %]</p>
- [%~ IF additional_information %]
- <p style="[% secondary_p_style %]">[% additional_information %]</p>
- [%~ END %]
<p style="[% secondary_p_style %]">
<strong>Location:</strong>
<br>Easting/Northing
diff --git a/templates/email/tfl/submit.txt b/templates/email/tfl/submit.txt
index b6af867ff..6c1f323b0 100644
--- a/templates/email/tfl/submit.txt
+++ b/templates/email/tfl/submit.txt
@@ -31,8 +31,6 @@ Subject: [% report.title %]
Details: [% report.detail %]
-[% additional_information %]
-
Easting/Northing
[%- " (IE)" IF coordsyst == "I" -%]
: [% easting %]/[% northing %]