SendEmail Reactor accept Content-type from template

Bug #1673458 reported by Doug Kyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

I wanted to send html from AT event templates, so made SendEmail reactor accept the Content-type header.

--- a/2_11/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm
+++ b/2_11/lib/OpenILS/Application/Trigger/Reactor/SendEmail.pm
@@ -58,13 +58,13 @@ sub handler {

     my $email = Email::Simple->new($text);

- for my $hfield (qw/From To Subject Bcc Cc Reply-To Sender/) {
+ for my $hfield (qw/From To Subject Bcc Cc Reply-To Sender Content-Type/) {
  my @headers = $email->header($hfield);
  $email->header_set($hfield => map { encode("MIME-Header", $_) } @headers) if ($headers[0]);
     }

     $email->header_set('MIME-Version' => '1.0');
- $email->header_set('Content-Type' => "text/plain; charset=UTF-8");
+ $email->header_set('Content-Type' => "text/plain; charset=UTF-8") unless $email->header('Content-Type');
     $email->header_set('Content-Transfer-Encoding' => '8bit');

     try {

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.