diff options
author | Marius Halden <marius.h@lden.org> | 2020-09-29 14:23:52 +0200 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2020-09-29 14:23:52 +0200 |
commit | a27ce1524d801d2742a2bdb6ec1da45126d64353 (patch) | |
tree | 64123c4e17dc1776aa0a7cd65ee01d49d3e7d978 /perllib/FixMyStreet/Email.pm | |
parent | 377bd96aab7cad3434185c30eb908c9da447fe40 (diff) | |
parent | 2773c60226b9370fe8ee00f7b205b571bb87c3b5 (diff) |
Merge tag 'v3.0.1' into fiksgatami-dev
Diffstat (limited to 'perllib/FixMyStreet/Email.pm')
-rw-r--r-- | perllib/FixMyStreet/Email.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Email.pm b/perllib/FixMyStreet/Email.pm index 2b72b5c63..3d7b48539 100644 --- a/perllib/FixMyStreet/Email.pm +++ b/perllib/FixMyStreet/Email.pm @@ -152,7 +152,7 @@ sub find_template_dir { sub send_cron { my ( $schema, $template, $vars, $hdrs, $env_from, $nomail, $cobrand, $lang_code ) = @_; - my $sender = FixMyStreet->config('DO_NOT_REPLY_EMAIL'); + my $sender = $cobrand->do_not_reply_email; $env_from ||= $sender; if (!$hdrs->{From}) { my $sender_name = $cobrand->contact_name; @@ -169,15 +169,20 @@ sub send_cron { push @include_path, FixMyStreet->path_to( 'templates', 'email', 'default' ); my $tt = FixMyStreet::Template->new({ INCLUDE_PATH => \@include_path, + disable_autoescape => 1, }); $vars->{signature} = _render_template($tt, 'signature.txt', $vars); $vars->{site_name} = Utils::trim_text(_render_template($tt, 'site-name.txt', $vars)); + $vars->{staging} = FixMyStreet->config('STAGING_SITE'); $hdrs->{_body_} = _render_template($tt, $template, $vars); if ($html_template) { my @inline_images; $vars->{inline_image} = sub { add_inline_image(\@inline_images, @_) }; $vars->{file_exists} = sub { -e FixMyStreet->path_to(@_) }; + my $tt = FixMyStreet::Template->new({ + INCLUDE_PATH => \@include_path, + }); $hdrs->{_html_} = _render_template($tt, $html_template, $vars); $hdrs->{_html_images_} = \@inline_images; } @@ -357,8 +362,9 @@ sub construct_email ($) { } } - if ($p->{_attachments_}) { + if (@{$p->{_attachments_}}) { push @$parts, map { _mime_create(%$_) } @{$p->{_attachments_}}; + $overall_type = 'multipart/mixed'; } my $email = Email::MIME->create( |