diff options
Diffstat (limited to 'bin/send-reports')
-rwxr-xr-x | bin/send-reports | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/send-reports b/bin/send-reports index 3e6a7fef6..6254337c6 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -27,6 +27,7 @@ use mySociety::Config; use mySociety::DBHandle qw(dbh); use mySociety::Email; use mySociety::EmailUtil; +use mySociety::GeoUtil; use mySociety::Locale; use mySociety::MaPit; use mySociety::Random qw(random_bytes); @@ -97,6 +98,21 @@ foreach my $row (@$unsent) { : _('The user could not locate the problem on a map, but to see the area around the location they entered'); $h{closest_address} = ''; $h{closest_address_machine} = ''; + + # If we are in the UK include eastings and northings + $h{easting_northing} = ''; + if ( mySociety::Config::get('COUNTRY') eq 'GB' ) { + + ( $h{easting}, $h{northing} ) = + mySociety::GeoUtil::wgs84_to_national_grid( # + $h{latitude}, $h{longitude}, 'G' + ); + + # email templates don't have conditionals so we need to farmat this here + $h{easting_northing} # + = "Easting: $h{easting}\n\n" # + . "Northing: $h{northing}\n\n"; + } my (@to, @recips, $template, $areas_info); if ($site eq 'emptyhomes') { |