Forums / Extensions / eZ Newsletter / Bug in eZ Newsletter, HTML vs. plain text email

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?

eZ debug

Timing: Jan 29 2025 14:45:05
Script start
Timing: Jan 29 2025 14:45:05
Module start 'content'
Timing: Jan 29 2025 14:45:05
Module end 'content'
Timing: Jan 29 2025 14:45:05
Script end

Main resources:

Total runtime0.1595 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.2109180.7500
Module start 'content' 0.00640.0059 768.960995.0703
Module end 'content' 0.01220.1472 864.0313524.6797
Script end 0.1594  1,388.7109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00301.8756200.0001
Check MTime0.00120.7786200.0001
Mysql Total
Database connection0.00060.381210.0006
Mysqli_queries0.119474.86231410.0008
Looping result0.00100.62571390.0000
Template Total0.146992.110.1469
Template load0.00080.532910.0008
Template processing0.146191.581510.1461
Override
Cache load0.00050.312910.0005
Sytem overhead
Fetch class attribute can translate value0.00060.391910.0006
XML
Image XML parsing0.00030.172310.0003
General
dbfile0.00513.1735200.0003
String conversion0.00000.003330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs