From 50a42beded956ade156b36426b31f6400cf63bdb Mon Sep 17 00:00:00 2001 From: Sophie Meynieux Date: Wed, 30 Oct 2013 17:48:31 +0100 Subject: [PATCH] Bug 11173 : Notifications by email lacks carriage returns if content type is HTML Test plan : - Define one letter template for overdues for example - Check "HTML Message" - Define some overdue rules that are using this letter - Find one borrower that has overdues triggering this notification. - Run misc/cronjobs/overdue_notices.pl to generate the message and change to_address to give your email Without patch : - run misc/cronjobs/process_messsage_queue.pl => email content is all on one line With the patch : - change message status to 'pending' so that it could be sent once again - run misc/cronjobs/process_message_queue.pl => email content is displaid correctly with carriage returns as defined in template --- C4/Letters.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Letters.pm b/C4/Letters.pm index 7125148..3d9e9cb 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -977,6 +977,9 @@ sub _send_message_by_email { sub _wrap_html { my ($content, $title) = @_; + $content=~s/\n/
/g; + $content=~s/\r//g; + my $css = C4::Context->preference("NoticeCSS") || ''; $css = qq{} if $css; return <