diff options
author | Marius Halden <marius.h@lden.org> | 2016-06-11 14:12:04 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2016-06-11 14:12:04 +0200 |
commit | 1307e0674c8b0174f71b960785230c647320885c (patch) | |
tree | 305f74ebeaba78a01f1c0d919e8180941a3ee63d /perllib/FixMyStreet/Script/Alerts.pm | |
parent | 05310eb3ace46ab71d8d426359f17f5beeb7c115 (diff) | |
parent | 35e58052f4f1250a3c1bb40d126e36fcc735d209 (diff) |
Merge tag 'v1.8.3' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/Script/Alerts.pm')
-rw-r--r-- | perllib/FixMyStreet/Script/Alerts.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm index e799a5446..062601044 100644 --- a/perllib/FixMyStreet/Script/Alerts.pm +++ b/perllib/FixMyStreet/Script/Alerts.pm @@ -7,7 +7,7 @@ use DateTime::Format::Pg; use IO::String; use mySociety::DBHandle qw(dbh); -use mySociety::Gaze; +use FixMyStreet::Gaze; use mySociety::Locale; use mySociety::MaPit; use RABX; @@ -175,10 +175,10 @@ sub send() { my $longitude = $alert->parameter; my $latitude = $alert->parameter2; - my $d = mySociety::Gaze::get_radius_containing_population($latitude, $longitude, 200000); + my $d = FixMyStreet::Gaze::get_radius_containing_population($latitude, $longitude); # Convert integer to GB locale string (with a ".") $d = mySociety::Locale::in_gb_locale { - sprintf("%f", int($d*10+0.5)/10); + sprintf("%f", $d); }; my $states = "'" . join( "', '", FixMyStreet::DB::Result::Problem::visible_states() ) . "'"; my %data = ( @@ -248,8 +248,6 @@ sub _send_aggregated_alert_email(%) { } ); $data{unsubscribe_url} = $cobrand->base_url( $data{cobrand_data} ) . '/A/' . $token->token; - my $template = FixMyStreet->get_email_template($cobrand->moniker, $data{lang}, "$data{template}.txt"); - my $sender = sprintf('<fms-%s@%s>', FixMyStreet::Email::generate_verp_token('alert', $data{alert_id}), FixMyStreet->config('EMAIL_DOMAIN') @@ -257,9 +255,9 @@ sub _send_aggregated_alert_email(%) { my $result = FixMyStreet::Email::send_cron( $data{schema}, + "$data{template}.txt", + \%data, { - _template_ => $template, - _parameters_ => \%data, To => $data{alert_email}, }, $sender, |