TT#76552 send_template: log mail sending actions

We need to trace sending mails to be able to track down
possibly not sent mails, see e.g. MT#31936.

Use quotesensitive to not leak from/to information into logs,
but handle this properly to ensure we're GDPR safe.

Change-Id: I4d09d073e12b1dd61053956252b59ad06a29d59d
mr11.2
Michael Prokop 3 years ago
parent 67f6063341
commit 2b3a18b190

@ -30,6 +30,8 @@ sub send_template {
my ($c, $vars, $subject, $body, $from, $to) = @_;
my $t = Template->new;
$c->log->info("Trying to send mail from '" . $c->qs($from) . "' to '" . $c->qs($to) . "'");
my $processed_body = "";
$t->process(\$body, $vars, \$processed_body) ||
die "error processing email template body, type=".$t->error->type.", info='".$t->error->info."'";
@ -58,6 +60,8 @@ sub send_template {
# to => $template_processed->{to},
#);
$c->log->info("Successfully handed over mail from '" . $c->qs($from) . "' to '" . $c->qs($to) . "'");
return 1;
}

Loading…
Cancel
Save