From c727dce578b1dc598c0cb25537b2520de1648fde Mon Sep 17 00:00:00 2001 From: blake Date: Fri, 8 Jan 2016 09:41:49 -0600 Subject: [PATCH] LP1532236 Evergreen should allow for HTML formatted action trigger emails Simple fix for allowing the AT template to drive the email headers instead of replacing the headers blindly. Kudos to tsbere for the unless idea. Testing: setup an action trigger for SendEmail. Make sure your AT template includes an email header (EG: Content-Type: text/html;charset=utf-8) Setup a hold/circulation that meets the criteria of your action trigger. Check the resuting email's headers to match what you had put into the template. Signed-off-by: blake --- .../perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm index 5cf08c3b70..723733ac77 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm @@ -54,9 +54,9 @@ sub handler { my $err; my $email = Email::Simple->new($text); - $email->header_set('MIME-Version' => '1.0'); - $email->header_set('Content-Type' => "text/plain; charset=UTF-8"); - $email->header_set('Content-Transfer-Encoding' => '8bit'); + $email->header_set('MIME-Version' => '1.0') unless $email->header('MIME-Version'); + $email->header_set('Content-Type' => "text/plain; charset=UTF-8") unless $email->header('Content-Type'); + $email->header_set('Content-Transfer-Encoding' => '8bit') unless $email->header('Content-Transfer-Encoding'); try { $stat = $sender->send($email); -- 2.11.0