aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/View/EmailText.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-11-27 20:15:33 +0000
committerMatthew Somerville <matthew@mysociety.org>2019-12-09 09:38:03 +0000
commit2e9e82dfb57b972d1351ecef86687a0d067598b1 (patch)
tree189119d0c2be5b0327855609d27cb745a3d14d7b /perllib/FixMyStreet/App/View/EmailText.pm
parent6c2d3d5a7d84521d34daa2cf7e4be76a54b3b0e0 (diff)
Switch to default-escaped in email templates.
We add a way to process a template with no auto-escaping, that can be used for the text parts of emails, and mark various HTML output as safe.
Diffstat (limited to 'perllib/FixMyStreet/App/View/EmailText.pm')
-rwxr-xr-xperllib/FixMyStreet/App/View/EmailText.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/View/EmailText.pm b/perllib/FixMyStreet/App/View/EmailText.pm
new file mode 100755
index 000000000..6b28ca13f
--- /dev/null
+++ b/perllib/FixMyStreet/App/View/EmailText.pm
@@ -0,0 +1,29 @@
+package FixMyStreet::App::View::EmailText;
+use base 'Catalyst::View::TT';
+
+use strict;
+use warnings;
+
+use FixMyStreet;
+use FixMyStreet::Template;
+
+__PACKAGE__->config(
+ CLASS => 'FixMyStreet::Template',
+ TEMPLATE_EXTENSION => '.txt',
+ INCLUDE_PATH => [ FixMyStreet->path_to( 'templates', 'email', 'default' ) ],
+ render_die => 1,
+ disable_autoescape => 1,
+);
+
+=head1 NAME
+
+FixMyStreet::App::View::EmailText - TT View for FixMyStreet::App
+
+=head1 DESCRIPTION
+
+A TT view for the text part of emails - so no HTML auto-escaping
+
+=cut
+
+1;
+