aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm25
1 files changed, 3 insertions, 22 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index 72cd42952..2d5e85f3e 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -16,9 +16,6 @@ sub build_recipient_list {
my ($body_email, $state, $note) = ( $contact->email, $contact->state, $contact->note );
- $body_email = swandt_contact($row->latitude, $row->longitude)
- if $body->name eq 'Somerset West and Taunton Council' && $body_email eq 'SPECIAL';
-
unless ($state eq 'confirmed') {
$all_confirmed = 0;
$note = 'Body ' . $row->bodies_str . ' deleted'
@@ -56,10 +53,11 @@ sub send_from {
sub envelope_sender {
my ($self, $row) = @_;
+ my $cobrand = $row->get_cobrand_logged;
if ($row->user->email && $row->user->email_verified) {
- return FixMyStreet::Email::unique_verp_id('report', $row->id);
+ return FixMyStreet::Email::unique_verp_id([ 'report', $row->id ], $cobrand->call_hook('verp_email_domain'));
}
- return $row->get_cobrand_logged->do_not_reply_email;
+ return $cobrand->do_not_reply_email;
}
sub send {
@@ -128,21 +126,4 @@ sub email_list {
return \@list;
}
-# SW&T has different contact addresses depending upon the old district
-sub swandt_contact {
- my $district = _get_district_for_contact(@_);
- my $email;
- $email = ['customerservices', 'westsomerset'] if $district == 2427;
- $email = ['enquiries', 'tauntondeane'] if $district == 2429;
- return join('@', $email->[0], $email->[1] . '.gov.uk');
-}
-
-sub _get_district_for_contact {
- my ( $lat, $lon ) = @_;
- my $district =
- FixMyStreet::MapIt::call( 'point', "4326/$lon,$lat", type => 'DIS', generation => 34 );
- ($district) = keys %$district;
- return $district;
-}
-
1;