From f92fa912ef079d28c1392c10ede73c0b072573c1 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 25 May 2016 10:18:23 +0100 Subject: 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. --- perllib/FixMyStreet/Script/Questionnaires.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'perllib/FixMyStreet/Script/Questionnaires.pm') diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm index f72f59077..c5bc6bfe0 100644 --- a/perllib/FixMyStreet/Script/Questionnaires.pm +++ b/perllib/FixMyStreet/Script/Questionnaires.pm @@ -52,8 +52,6 @@ sub send_questionnaires_period { # call checks if this is the host that sends mail for this cobrand. next unless $cobrand->email_host; - my $template = FixMyStreet->get_email_template($cobrand->moniker, $row->lang, 'questionnaire.txt'); - my %h = map { $_ => $row->$_ } qw/name title detail category/; $h{created} = Utils::prettify_duration( time() - $row->confirmed->epoch, 'week' ); @@ -78,14 +76,15 @@ sub send_questionnaires_period { my $result = FixMyStreet::Email::send_cron( $rs->result_source->schema, + 'questionnaire.txt', + \%h, { - _template_ => $template, - _parameters_ => \%h, To => [ [ $row->user->email, $row->name ] ], }, undef, $params->{nomail}, - $cobrand + $cobrand, + $row->lang, ); unless ($result) { print " ...success\n" if $params->{verbose}; -- cgit v1.2.3