aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-05-16 18:25:32 +0100
committerMatthew Somerville <matthew@mysociety.org>2014-05-16 18:25:32 +0100
commit90208bb808c84209b16ce1628e04a8eaa6e10448 (patch)
tree65d02dd615762cabdfdbc2a026885ebef1ea23e2 /perllib/FixMyStreet/DB
parentbf062b508081521201cf315f483b7aee3a6a0c7b (diff)
parent3687cc573db7fbdae09773d9007bc6abeac89409 (diff)
Merge branch '700-auto-emails'
Diffstat (limited to 'perllib/FixMyStreet/DB')
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm2
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/AlertType.pm2
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm6
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm5
4 files changed, 11 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 7b5460c51..56a915c89 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -604,7 +604,7 @@ sub body {
$body = join( _(' and '),
map {
my $name = $_->name;
- if (mySociety::Config::get('AREA_LINKS_FROM_PROBLEMS')) {
+ if ($c and mySociety::Config::get('AREA_LINKS_FROM_PROBLEMS')) {
'<a href="' . $_->url($c) . '">' . $name . '</a>';
} else {
$name;
diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
index 545b54c60..984e698e0 100644
--- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
@@ -271,6 +271,8 @@ sub _send_aggregated_alert_email(%) {
$sender,
[ $data{alert_email} ],
0,
+ $cobrand,
+ $data{lang}
);
if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) {
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index c108f7e29..2f4bc6363 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -440,7 +440,7 @@ sub send_reports {
lastupdate => \'ms_current_timestamp()',
} );
if ( $cobrand->report_sent_confirmation_email && !$h{anonymous_report}) {
- _send_report_sent_email( $row, \%h, $nomail );
+ _send_report_sent_email( $row, \%h, $nomail, $cobrand );
}
debug_print("send successful: OK", $row->id) if $debug_mode;
} else {
@@ -493,6 +493,7 @@ sub _send_report_sent_email {
my $row = shift;
my $h = shift;
my $nomail = shift;
+ my $cobrand = shift;
my $template = 'confirm_report_sent.txt';
my $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $row->lang, $template )->stringify;
@@ -511,7 +512,8 @@ sub _send_report_sent_email {
},
mySociety::Config::get('CONTACT_EMAIL'),
[ $row->user->email ],
- $nomail
+ $nomail,
+ $cobrand
);
}
diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
index 6f2c19b5e..64ba8ec6a 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
@@ -98,6 +98,8 @@ sub send_questionnaires_period {
. $row->user->email . "\n"
if $params->{verbose};
+ $h{site_name} = $cobrand->site_title();
+
my $result = FixMyStreet::App->send_email_cron(
{
_template_ => $template,
@@ -107,7 +109,8 @@ sub send_questionnaires_period {
},
$sender,
[ $row->user->email ],
- $params->{nomail}
+ $params->{nomail},
+ $cobrand
);
if ($result == mySociety::EmailUtil::EMAIL_SUCCESS) {
print " ...success\n" if $params->{verbose};