aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2011-06-13 11:37:01 +0100
committerMatthew Somerville <matthew@mysociety.org>2011-06-13 11:37:01 +0100
commit649e30f812dea1b3567e234e7cea26bef83ecaa1 (patch)
tree13ee30ca98aa52ddf9c091a3d0babd812f072243
parent0e24f8d44713a530fc733f9e0dbf3e7c5bf63e4a (diff)
Fall back to default alert template too.
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/AlertType.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
index d925da380..e92846aca 100644
--- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm
@@ -177,12 +177,12 @@ sub _send_aggregated_alert_email(%) {
$data{unsubscribe_url} = $cobrand->base_url_for_emails( $data{cobrand_data} ) . '/A/' . $token->token;
my $template = FixMyStreet->path_to(
- "templates", "email", $cobrand->moniker, "$data{template}.txt"
- )->stringify;
- my $template_cobrand = FixMyStreet->path_to(
"templates", "email", $cobrand->moniker, $data{lang}, "$data{template}.txt"
)->stringify;
- $template = $template_cobrand if -e $template_cobrand;
+ $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, "$data{template}.txt" )->stringify
+ unless -e $template;
+ $template = FixMyStreet->path_to( "templates", "email", "default", "$data{template}.txt" )->stringify
+ unless -e $template;
$template = File::Slurp::read_file($template);
my $sender = $cobrand->contact_email;