diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-27 14:07:23 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-11-27 14:07:23 +0000 |
commit | 1540960b6895ba10471d3eb936519f18e856ae2b (patch) | |
tree | b19c2f05f6662abae5375704c393f96bef38982c | |
parent | 272ccab84a70f8d3db8836571756e81a0afc8747 (diff) |
Read in autoresponse template as UTF-8.
-rwxr-xr-x | bin/handlemail | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/handlemail b/bin/handlemail index 6cdc8fbd8..8d745a3a8 100755 --- a/bin/handlemail +++ b/bin/handlemail @@ -20,6 +20,7 @@ BEGIN { } use Getopt::Long; +use Path::Tiny; use FixMyStreet; use FixMyStreet::DB; use FixMyStreet::Email; @@ -170,10 +171,8 @@ sub handle_non_bounce_to_null_address { # Send an automatic response print_log('info', "Received non-bounce to null address, auto-replying"); - my $template = 'reply-autoresponse'; - my $fp = FixMyStreet->path_to("templates", "email", $cobrand, $template)->open or exit 75; - $template = join('', <$fp>); - $fp->close; + + my $template = path(FixMyStreet->path_to("templates", "email", $cobrand, 'reply-autoresponse'))->slurp_utf8; # We generate this as a bounce. my ($rp) = $data{return_path} =~ /^\s*<(.*)>\s*$/; |