From b2a9d102ce4ad3725178ae952b92b93af23b883a Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 4 Mar 2021 17:54:22 +0100 Subject: [PATCH] Bug 27884: Add html support for report mails To test: 1) Create a new notice, for example with Koha module "Patrons", name/code TEST and message body "testing". 2) Create a new sql report, the query could be someting like: SELECT "" as `borrowernumber`, "to@example.com", as `email`, "from@example.com" as `from`; where "" is a valid borrowernumber. 3) Run patron_emailer.pl --report= --notice=TEST --module=members -commit where is the report id. 4) Check the message_queue table that the content_type column has been set to text/html; charset="UTF-8". 5) Ideally process the message queue and veriy that the sent email is displayed as rendered html. 6) Run tests in t/db_dependent/Reports/Guided.t Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 43066b8cd372cbfe1736e3022c333b6ed88c1f59) Signed-off-by: Fridolin Somers --- C4/Reports/Guided.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 8c89165e2a..13898aeaac 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -1028,6 +1028,7 @@ sub EmailReport { message_transport_type => 'email', }); $letter = $letter->unblessed; + $letter->{'content-type'} = 'text/html; charset="UTF-8"' if $letter->{'is_html'}; my $report = Koha::Reports->find( $report_id ); my $sql = $report->savedsql; -- 2.39.5