From 148d702917f54327f82e49fe605e5a0d9f2e31ca Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 16 Sep 2016 17:58:16 +0100 Subject: Use shared Template base for all templates. Reduce some duplicated code, and as a side effect gives HTML emails our internal html_para filter, allowing single line returns in contact form submissions. --- perllib/FixMyStreet/Email.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'perllib/FixMyStreet/Email.pm') diff --git a/perllib/FixMyStreet/Email.pm b/perllib/FixMyStreet/Email.pm index 34ac1514c..7d81c9dc5 100644 --- a/perllib/FixMyStreet/Email.pm +++ b/perllib/FixMyStreet/Email.pm @@ -10,7 +10,7 @@ use Email::MIME; use Encode; use File::Spec; use POSIX qw(); -use Template; +use FixMyStreet::Template; use Digest::HMAC_SHA1 qw(hmac_sha1_hex); use mySociety::Locale; use mySociety::Random qw(random_bytes); @@ -162,8 +162,7 @@ sub send_cron { my $html_template = get_html_template($template, @include_path); push @include_path, FixMyStreet->path_to( 'templates', 'email', 'default' ); - my $tt = Template->new({ - ENCODING => 'utf8', + my $tt = FixMyStreet::Template->new({ INCLUDE_PATH => \@include_path, }); $vars->{signature} = _render_template($tt, 'signature.txt', $vars); -- cgit v1.2.3