diff options
author | Dave Arter <davea@mysociety.org> | 2018-01-11 21:53:55 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-10 10:42:33 +0100 |
commit | df3d19345308919957b42dad3970d81c90a25b58 (patch) | |
tree | 84ed76c00349229c5c50ff7bd8ce6dfdd9c2c257 | |
parent | cfacd7dc51ae92f593a7001f481199ee9021b17f (diff) |
[BANES] Add Email::BathNES send method with custom template for street light reports
4 files changed, 146 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm index fbe93c1af..6e9244c9c 100644 --- a/perllib/FixMyStreet/Cobrand/BathNES.pm +++ b/perllib/FixMyStreet/Cobrand/BathNES.pm @@ -61,4 +61,11 @@ sub map_js_extra { } } +sub category_extra_hidden { + my ($self, $meta) = @_; + return 1 if $meta eq 'unitid' || $meta eq 'asset_details'; + return 0; +} + + 1; diff --git a/perllib/FixMyStreet/SendReport/Email/BathNES.pm b/perllib/FixMyStreet/SendReport/Email/BathNES.pm new file mode 100644 index 000000000..786d36d1e --- /dev/null +++ b/perllib/FixMyStreet/SendReport/Email/BathNES.pm @@ -0,0 +1,16 @@ +package FixMyStreet::SendReport::Email::BathNES; + +use Moo; + +BEGIN { extends 'FixMyStreet::SendReport::Email'; } + +sub get_template { + my ( $self, $row ) = @_; + if ( $row->category eq 'Street Light Fault' ) { + return 'bathnes/submit-street-light-fault.txt'; + } else { + return 'submit.txt'; + } +} + +1; diff --git a/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html new file mode 100644 index 000000000..8af8ea1b0 --- /dev/null +++ b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.html @@ -0,0 +1,79 @@ +<h2>Customer Details</h2> + +<table> +<tr> +<th>Name</th> +<td>[% name %]</td> +</tr> +<tr> +<th>Email</th> +<td>[% email OR 'None provided' %]</td> +</tr> +<tr> +<th>Phone</th> +<td>[% phone OR 'None provided' %]</td> +</tr> +</table> + + +<h2>Enquiry Details</h2> + +<table> +<tr> +<th>Date & Time logged</th> +<td>[% confirmed %]</td> +</tr> +<tr> +<th>Report type</th> +<td>[% report.get_extra_field_value('FaultType') %]</td> +</tr> +<tr> +<th>5 or more lights affected</th> +<td>[% report.get_extra_field_value('5Lights') %]</td> +</tr> +<tr> +<th>Unit Number</th> +<td>[% report.get_extra_field_value('unitid') %]</td> +</tr> +<tr> +<th>Title</th> +<td>[% title %]</td> +</tr> +<tr> +<th>Description</th> +<td>[% detail %]</td> +</tr> +<tr> +<th>URL</th> +<td>[% url %]</td> +</tr> +</table> +[% additional_information %] + + +<h2>Location Details</h2> + +<table> +<tr> +<th>Unit description and location</th> +<td>[% report.get_extra_field_value('asset_details') %]</td> +</tr> +<tr> +<th>Easting/Northing</th> +<td>[% easting %] [% northing %]</td> +</tr> +<tr> +<th>Latitude</th> +<td>[% latitude %]</td> +</tr> +<tr> +<th>Longitude</th> +<td>[% longitude %]</td> +</tr> +<tr> +<th></th> +<td>[% closest_address %]</td> +</tr> +</table> + +<strong>NB:</strong> Replies to this email will go to the user who submitted the problem. diff --git a/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt new file mode 100644 index 000000000..a860c0a34 --- /dev/null +++ b/templates/email/fixmystreet.com/bathnes/submit-street-light-fault.txt @@ -0,0 +1,44 @@ +Subject: Street Light Fault: [% title %] + +Customer Details + +Name: [% name %] + +Email: [% email OR 'None provided' %] + +Phone: [% phone OR 'None provided' %] + + +Enquiry Details + +Date & Time logged: [% confirmed %] + +Report type: [% report.get_extra_field_value('FaultType') %] + +5 or more lights affected: [% report.get_extra_field_value('5Lights') %] + +Unit Number: [% report.get_extra_field_value('unitid') %] + + +Title: [% title %] + +Description: [% detail %] + +[% additional_information %] + +[% url %] + +Location Details + +Unit description and location: [% report.get_extra_field_value('asset_details') %] + +Easting/Northing: [% easting %]/[% northing %] + +Latitude: [% latitude %] + +Longitude: [% longitude %] + +[% closest_address %] + + +Replies to this email will go to the user who submitted the problem. |