aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/SendReport/Email.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/SendReport/Email.pm
parent8d97bff0663729b2abea6f7a38a547515cb23f9a (diff)
refactor repeat code into get_email_template
Diffstat (limited to 'perllib/FixMyStreet/SendReport/Email.pm')
-rw-r--r--perllib/FixMyStreet/SendReport/Email.pm8
1 files changed, 2 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/SendReport/Email.pm b/perllib/FixMyStreet/SendReport/Email.pm
index d71700020..2eb6bc279 100644
--- a/perllib/FixMyStreet/SendReport/Email.pm
+++ b/perllib/FixMyStreet/SendReport/Email.pm
@@ -62,12 +62,8 @@ sub get_template {
my $template = 'submit.txt';
$template = 'submit-brent.txt' if $row->bodies_str eq 2488 || $row->bodies_str eq 2237;
- 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 );
+
+ $template = FixMyStreet->get_email_template($row->cobrand, $row->lang, $template);
return $template;
}