diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-09 10:43:27 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-03-14 15:36:27 +0000 |
commit | 7361516252a4d98620f66318cabe75acb3291efb (patch) | |
tree | d830bd8035c602e75e6f5e83aaff9cbabcaad0fd | |
parent | 8b19bd2c900e94b1dff643211a4b3a93c8718c27 (diff) |
Remove duplicate <> around envelope senders.
-rw-r--r-- | perllib/FixMyStreet/Email.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Alerts.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/perllib/FixMyStreet/Email.pm b/perllib/FixMyStreet/Email.pm index 7d81c9dc5..e0d82a8ef 100644 --- a/perllib/FixMyStreet/Email.pm +++ b/perllib/FixMyStreet/Email.pm @@ -77,6 +77,10 @@ sub _render_template { return $var; } +sub unique_verp_id { + sprintf('fms-%s@%s', generate_verp_token(@_), FixMyStreet->config('EMAIL_DOMAIN')); +} + sub _unique_id { sprintf('fms-%s-%s@%s', time(), unpack('h*', random_bytes(5, 1)), diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm index 65183c09c..1a760a0c1 100644 --- a/perllib/FixMyStreet/Script/Alerts.pm +++ b/perllib/FixMyStreet/Script/Alerts.pm @@ -283,11 +283,7 @@ sub _send_aggregated_alert_email(%) { } ); $data{unsubscribe_url} = $cobrand->base_url( $data{cobrand_data} ) . '/A/' . $token->token; - my $sender = sprintf('<fms-%s@%s>', - FixMyStreet::Email::generate_verp_token('alert', $data{alert_id}), - FixMyStreet->config('EMAIL_DOMAIN') - ); - + my $sender = FixMyStreet::Email::unique_verp_id('alert', $data{alert_id}); 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 5a287a208..8fedc48b5 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -88,10 +88,7 @@ sub send { $params->{Bcc} = $self->bcc if @{$self->bcc}; - my $sender = sprintf('<fms-%s@%s>', - FixMyStreet::Email::generate_verp_token('report', $row->id), - FixMyStreet->config('EMAIL_DOMAIN') - ); + my $sender = FixMyStreet::Email::unique_verp_id('report', $row->id); if (FixMyStreet::Email::test_dmarc($params->{From}[0])) { $params->{'Reply-To'} = [ $params->{From} ]; |