From 819bac8ab6fa16fc260efb953db15c758dbc7109 Mon Sep 17 00:00:00 2001 From: Steven Day Date: Tue, 21 Oct 2014 15:23:00 +0100 Subject: Pass cobrand into send_email_cron when sending SendReport emails Without this, email sending within a cobrand will get the right main email template (submit.txt) for the email - because it uses the cobrand inside get_template - but it doesn't use the cobrand for things like the email signature, because you have to pass it into send_email_cron manually to make it cobrand-aware. This probably hasn't been noticed before because most cobrands are called Something FixMyStreet, but Collideoscope is different and hence it caused a problem there. Closes mysociety/FixMyStreet-Commercial#621. --- perllib/FixMyStreet/SendReport/Email.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 2eb6bc279..19c6405d2 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -89,6 +89,7 @@ sub send { } my ($verbose, $nomail) = CronFns::options(); + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($row->cobrand)->new(); my $result = FixMyStreet::App->send_email_cron( { _template_ => $self->get_template( $row ), @@ -98,7 +99,8 @@ sub send { }, mySociety::Config::get('CONTACT_EMAIL'), \@recips, - $nomail + $nomail, + $cobrand ); if ( $result == mySociety::EmailUtil::EMAIL_SUCCESS ) { -- cgit v1.2.3