diff options
Diffstat (limited to 'perllib/FixMyStreet/Script')
-rw-r--r-- | perllib/FixMyStreet/Script/Alerts.pm | 6 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Questionnaires.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/Script/Reports.pm | 9 |
3 files changed, 10 insertions, 14 deletions
diff --git a/perllib/FixMyStreet/Script/Alerts.pm b/perllib/FixMyStreet/Script/Alerts.pm index fc5fef953..062601044 100644 --- a/perllib/FixMyStreet/Script/Alerts.pm +++ b/perllib/FixMyStreet/Script/Alerts.pm @@ -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, 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}; diff --git a/perllib/FixMyStreet/Script/Reports.pm b/perllib/FixMyStreet/Script/Reports.pm index 75111b852..278c58af1 100644 --- a/perllib/FixMyStreet/Script/Reports.pm +++ b/perllib/FixMyStreet/Script/Reports.pm @@ -289,19 +289,18 @@ sub _send_report_sent_email { my $nomail = shift; my $cobrand = shift; - my $template = FixMyStreet->get_email_template($row->cobrand, $row->lang, 'confirm_report_sent.txt'); - FixMyStreet::Email::send_cron( $row->result_source->schema, + 'confirm_report_sent.txt', + $h, { - _template_ => $template, - _parameters_ => $h, To => $row->user->email, From => [ FixMyStreet->config('CONTACT_EMAIL'), $cobrand->contact_name ], }, FixMyStreet->config('CONTACT_EMAIL'), $nomail, - $cobrand + $cobrand, + $row->lang, ); } |