diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-09-16 17:58:16 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-09-20 17:18:35 +0100 |
commit | 148d702917f54327f82e49fe605e5a0d9f2e31ca (patch) | |
tree | 465574714026090bda8301a655a1176c5323d426 /perllib/FixMyStreet/App/View/Email.pm | |
parent | 99abfad00e301e3a261820db0d54470d9c4ef10c (diff) |
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.
Diffstat (limited to 'perllib/FixMyStreet/App/View/Email.pm')
-rw-r--r-- | perllib/FixMyStreet/App/View/Email.pm | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/perllib/FixMyStreet/App/View/Email.pm b/perllib/FixMyStreet/App/View/Email.pm index 6073ee814..6d83d3ddf 100644 --- a/perllib/FixMyStreet/App/View/Email.pm +++ b/perllib/FixMyStreet/App/View/Email.pm @@ -4,17 +4,14 @@ use base 'Catalyst::View::TT'; use strict; use warnings; -use mySociety::Locale; use FixMyStreet; +use FixMyStreet::Template; __PACKAGE__->config( + CLASS => 'FixMyStreet::Template', TEMPLATE_EXTENSION => '.txt', - INCLUDE_PATH => [ # - FixMyStreet->path_to( 'templates', 'email', 'default' ), - ], - ENCODING => 'utf8', - render_die => 1, - expose_methods => ['loc', 'file_exists'], + INCLUDE_PATH => [ FixMyStreet->path_to( 'templates', 'email', 'default' ) ], + render_die => 1, ); =head1 NAME @@ -27,23 +24,5 @@ TT View for FixMyStreet::App. =cut -=head2 loc - - [% loc('Some text to localize') %] - -Passes the text to the localisation engine for translations. - -=cut - -sub loc { - my ( $self, $c, @args ) = @_; - return _(@args); -} - -sub file_exists { - my ( $self, $c, @args ) = @_; - -e FixMyStreet->path_to(@args); -} - 1; |