aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2014-07-11 13:57:02 +0000
committerHakim Cassimally <hakim@mysociety.org>2014-08-14 09:44:36 +0000
commitf16060fa322a4230a5b16a1e8c5b122307f29bee (patch)
treefb20f19916dd741cbc484528c9ecc619034cef6f /perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
parent8d97bff0663729b2abea6f7a38a547515cb23f9a (diff)
refactor repeat code into get_email_template
Diffstat (limited to 'perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm')
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm7
1 files changed, 1 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
index 64ba8ec6a..b7af9e60e 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
@@ -63,12 +63,7 @@ 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, $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 );
+ $template = FixMyStreet->get_email_template($cobrand->moniker, $row->lang, 'questionnaire.txt');
}
my %h = map { $_ => $row->$_ } qw/name title detail category/;