diff options
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Email.pm | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm index bbf0c9a9e..d6b3eb5cb 100644 --- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm @@ -62,7 +62,9 @@ sub send_questionnaires_period { ($template = $period) =~ s/ //; $template = Utils::read_file( FixMyStreet->path_to( "templates/email/emptyhomes/" . $row->lang . "/questionnaire-$template.txt" )->stringify ); } else { - $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, "questionnaire.txt" )->stringify; + $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, $row->lang, "questionnaire.txt" )->stringify; + $template = FixMyStreet->path_to( "templates", "email", $cobrand->moniker, "questionnaire.txt" )->stringify + unless -e $template; $template = FixMyStreet->path_to( "templates", "email", "default", "questionnaire.txt" )->stringify unless -e $template; $template = Utils::read_file( $template ); diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm index 11ca196fb..b69436dd7 100644 --- a/perllib/FixMyStreet/SendReport/Email.pm +++ b/perllib/FixMyStreet/SendReport/Email.pm @@ -46,7 +46,9 @@ sub get_template { my $template = 'submit.txt'; $template = 'submit-brent.txt' if $row->council eq 2488 || $row->council eq 2237; - my $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $template )->stringify; + my $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $row->lang, $template )->stringify; + $template_path = FixMyStreet->path_to( "templates", "email", $row->cobrand, $template )->stringify + unless -e $template_path; $template_path = FixMyStreet->path_to( "templates", "email", "default", $template )->stringify unless -e $template_path; $template = Utils::read_file( $template_path ); |