Bug in eZ Newsletter, HTML vs. plain text email

Author Message

Harry Oosterveen

Thursday 10 April 2008 8:22:01 am

The newsletter emails are generated in the class eZNewsletter; the contenttype is set to 'sms' or 'multipart/related' (for HTML newsletters), but never to 'text/plain'. Apparently, it assumes that the contenttype for the eZNewsletterMail class is always 'text/plain'.

However, when the eZNewsletterMail is created, the contenttype is initially set to 'text/plain', but subsequently changed into the prefered contenttype from the site.ini - MailSettings - ContentType settings. So if this is set to text/html, eZNewsletterMail will default to text/html, and plain text mails will be sent with the 'ContentType: text/html' header and will be displayed without line breaks.

To fix the bug, edit classes/eznewslettermail.php, and comment out lines 81/82 (this refers to version 1.5.3)

//    if ( $ini->hasVariable( 'MailSettings', 'ContentType' ) )
//        $this->setContentType( $ini->variable( 'MailSettings', 'ContentType' ) );

Pål Jostein Didriksen

Thursday 09 April 2009 11:46:56 am

I have the same problem, but using eZ 4.0.1 and eznewsletter 1.6. The eznewsletter.php looks different, missing the section you commented out.

I also get plain text-mails wihtout linebreaks, and my html-mails don't display at all. When I look at the message source, it looks something like this:

This message is in MIME format. Since your mail reader does not understandthis format, some or all of this message may not be legible.--200904091919911:12941:0Content-Type: text/html; charset=utf-8Content-Transfer-Encoding: 8bit<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>    <head>        <meta http-equiv="content-type" content="text/html; charset=windows-1250">								    </head>    <body style="margin:0;padding:0; font-family: Verdana;">	  </body></html>--200904091919911:12941:0--

--Boundary_(ID_0XT4Sdgy4yDfhOv69kVe4w)--

(Newsletter content was deleted to shorten the code)

Any experience on this issue?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:20:25
Script start
Timing: Jan 18 2025 11:20:25
Module start 'layout'
Timing: Jan 18 2025 11:20:25
Module start 'content'
Timing: Jan 18 2025 11:20:26
Module end 'content'
Timing: Jan 18 2025 11:20:26
Script end

Main resources:

Total runtime0.5313 sec
Peak memory usage4,096.0000 KB
Database Queries56

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 590.0938152.6563
Module start 'layout' 0.00660.0028 742.750039.5078
Module start 'content' 0.00940.5204 782.2578497.0859
Module end 'content' 0.52980.0015 1,279.34388.1016
Script end 0.5313  1,287.4453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.6028160.0002
Check MTime0.00130.2495160.0001
Mysql Total
Database connection0.00110.204610.0011
Mysqli_queries0.481790.6678560.0086
Looping result0.00060.1062540.0000
Template Total0.496193.420.2480
Template load0.00210.390920.0010
Template processing0.494092.974820.2470
Template load and register function0.00010.020110.0001
states
state_id_array0.00130.242610.0013
state_identifier_array0.00110.211220.0006
Override
Cache load0.00170.3143140.0001
Sytem overhead
Fetch class attribute can translate value0.00050.097120.0003
Fetch class attribute name0.00120.216630.0004
XML
Image XML parsing0.00220.419120.0011
class_abstraction
Instantiating content class attribute0.00000.001530.0000
General
dbfile0.00360.6763150.0002
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs