Bugzilla – Attachment 37016 Details for
Bug 12739
SendAlerts function does not take care of "html" format or UTF-8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12739 - SendAlerts function does not take care of "html" format or UTF-8 Pt. 2
Bug-12739---SendAlerts-function-does-not-take-care.patch (text/plain), 3.59 KB, created by
Marcel de Rooy
on 2015-03-19 16:11:37 UTC
(
hide
)
Description:
Bug 12739 - SendAlerts function does not take care of "html" format or UTF-8 Pt. 2
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-03-19 16:11:37 UTC
Size:
3.59 KB
patch
obsolete
>From 2c806e815c41dfab35c722dc4a49373646594d07 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 23 Dec 2014 14:13:39 +1100 >Subject: [PATCH] Bug 12739 - SendAlerts function does not take care of "html" > format or UTF-8 Pt. 2 >Content-Type: text/plain; charset=utf-8 > >The emails sent via SendAlerts don't take into account HTML format. > >_TEST PLAN_ > >Before applying: > >1) Change system preference "AutoEmailOpacUser" to "Send" >2) Change "ACCTDETAILS" notice to HTML and add HTML to it >3) Create a new user with your email address >4) Note how the email displays the HTML tags as plain text > >Apply patch > >5) Create a new user with your email address >6) Note how the email displays the email as an HTML email > >For thoroughness: > >7) Change "ACCTDETAILS" notice to non-HTML >8) Create a new user with your email address >9) Note how the email displays the HTML as plain text > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Letters.pm | 14 ++++++-------- > 1 files changed, 6 insertions(+), 8 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 3de1aa3..405dfed 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -430,10 +430,8 @@ sub SendAlerts { > replyto => $branchdetails->{'branchreplyto'}, > sender => $branchdetails->{'branchreturnpath'}, > subject => Encode::encode( "utf8", "" . $letter->{title} ), >- message => >- Encode::encode( "utf8", "" . $letter->{content} ), >- contenttype => 'text/plain; charset="utf-8"', >- >+ message => $letter->{'is_html'} ? _wrap_html( Encode::encode( "utf8", $letter->{'content'} ), Encode::encode( "utf8", "" . $letter->{'title'} ) ) : Encode::encode( "utf8", "" . $letter->{'content'} ), >+ contenttype => $letter->{'is_html'} ? 'text/html; charset="utf-8"' : 'text/plain; charset="utf-8"', > } > ); > sendmail(%mail) or carp $Mail::Sendmail::error; >@@ -518,8 +516,8 @@ sub SendAlerts { > Cc => join( ',', @cc), > From => $userenv->{emailaddress}, > Subject => Encode::encode( "utf8", "" . $letter->{title} ), >- Message => Encode::encode( "utf8", "" . $letter->{content} ), >- 'Content-Type' => 'text/plain; charset="utf-8"', >+ Message => $letter->{'is_html'} ? _wrap_html( Encode::encode( "utf8", $letter->{'content'} ), Encode::encode( "utf8", "" . $letter->{'title'} ) ) : Encode::encode( "utf8", "" . $letter->{'content'} ), >+ 'Content-Type' => $letter->{'is_html'} ? 'text/html; charset="utf-8"' : 'text/plain; charset="utf-8"', > ); > > $mail{'Reply-to'} = C4::Context->preference('ReplytoDefault') >@@ -567,8 +565,8 @@ sub SendAlerts { > replyto => $branchdetails->{'branchreplyto'}, > sender => $branchdetails->{'branchreturnpath'}, > subject => Encode::encode( "utf8", "" . $letter->{'title'} ), >- message => Encode::encode( "utf8", "" . $letter->{'content'} ), >- contenttype => 'text/plain; charset="utf-8"' >+ message => $letter->{'is_html'} ? _wrap_html( Encode::encode( "utf8", $letter->{'content'} ), Encode::encode( "utf8", "" . $letter->{'title'} ) ) : Encode::encode( "utf8", "" . $letter->{'content'} ), >+ contenttype => $letter->{'is_html'} ? 'text/html; charset="utf-8"' : 'text/plain; charset="utf-8"', > } > ); > sendmail(%mail) or carp $Mail::Sendmail::error; >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12739
:
34655
|
34656
|
34657
|
36174
|
36175
|
37015
| 37016 |
37018