diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-05-25 10:18:23 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-05-25 10:18:23 +0100 |
commit | f92fa912ef079d28c1392c10ede73c0b072573c1 (patch) | |
tree | 24328b22f6d3027d0d4e4eb2db734f622cca101a /perllib/FixMyStreet/SendReport | |
parent | eb3cebfcda16bfda4cfe261836d756e4699041aa (diff) |
Use only one templating system for emails.
Historically, emails sent offline (alerts, questionnaires, etc) used a
different templating system from those sent by the website (e.g. login
emails), though the newer system was also being used for the site name
and signature of offline emails.
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 17 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Zurich.pm | 2 |
2 files changed, 5 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 7e5c10469..8582ebb3b 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -52,15 +52,8 @@ sub build_recipient_list { sub get_template { my ( $self, $row ) = @_; - - my $template = 'submit.txt'; - - if ($row->cobrand eq 'fixmystreet') { - $template = 'submit-oxfordshire.txt' if $row->bodies_str eq 2237; - } - - $template = FixMyStreet->get_email_template($row->cobrand, $row->lang, $template); - return $template; + return 'submit-oxfordshire.txt' if $row->cobrand eq 'fixmystreet' && $row->bodies_str eq 2237; + return 'submit.txt'; } sub send_from { @@ -88,8 +81,6 @@ sub send { my ($verbose, $nomail) = CronFns::options(); my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($row->cobrand)->new(); my $params = { - _template_ => $self->get_template( $row ), - _parameters_ => $h, To => $self->to, From => $self->send_from( $row ), }; @@ -108,7 +99,9 @@ sub send { $params->{From} = [ $sender, $params->{From}[1] ]; } - my $result = FixMyStreet::Email::send_cron($row->result_source->schema, $params, $sender, $nomail, $cobrand); + my $result = FixMyStreet::Email::send_cron($row->result_source->schema, + $self->get_template($row), $h, + $params, $sender, $nomail, $cobrand, $row->lang); unless ($result) { $self->success(1); diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm index a8730bbe4..b38981d94 100644 --- a/perllib/FixMyStreet/SendReport/Zurich.pm +++ b/perllib/FixMyStreet/SendReport/Zurich.pm @@ -59,8 +59,6 @@ sub get_template { } } - my $template_path = FixMyStreet->path_to( "templates", "email", "zurich", $template )->stringify; - $template = Utils::read_file( $template_path ); return $template; } |