From 2b3a18b190ca47923906fcb5cff4a5092b4c7ad6 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 10 Oct 2022 18:33:56 +0200 Subject: [PATCH] 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 --- lib/NGCP/Panel/Utils/Email.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/NGCP/Panel/Utils/Email.pm b/lib/NGCP/Panel/Utils/Email.pm index baa0dead8c..e56b9d26a8 100644 --- a/lib/NGCP/Panel/Utils/Email.pm +++ b/lib/NGCP/Panel/Utils/Email.pm @@ -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; }