diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/Email.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Alerts.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 5 |
3 files changed, 7 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Email.pm b/perllib/FixMyStreet/Email.pm index 3d7b48539..0cc6a880c 100644 --- a/perllib/FixMyStreet/Email.pm +++ b/perllib/FixMyStreet/Email.pm @@ -79,7 +79,9 @@ sub _render_template { } sub unique_verp_id { - sprintf('fms-%s@%s', generate_verp_token(@_), FixMyStreet->config('EMAIL_DOMAIN')); + my $parts = shift; + my $domain = shift || FixMyStreet->config('EMAIL_DOMAIN'); + sprintf('fms-%s@%s', generate_verp_token(@$parts), $domain); } sub _unique_id { diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm index d07728092..03373a8cc 100644 --- a/perllib/FixMyStreet/Script/Alerts.pm +++ b/perllib/FixMyStreet/Script/Alerts.pm @@ -327,7 +327,7 @@ sub _send_aggregated_alert_email(%) { } ); $data{unsubscribe_url} = $cobrand->base_url( $data{cobrand_data} ) . '/A/' . $token->token; - my $sender = FixMyStreet::Email::unique_verp_id('alert', $data{alert_id}); + my $sender = FixMyStreet::Email::unique_verp_id([ 'alert', $data{alert_id} ], $cobrand->call_hook('verp_email_domain')); my $result = FixMyStreet::Email::send_cron( $data{schema}, "$data{template}.txt", diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 81a25f896..2d5e85f3e 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -53,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 { |