aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/SendReport')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm17
-rw-r--r--perllib/FixMyStreet/SendReport/Zurich.pm2
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;
}