Trouble with linebreaks in template used in mails

Author Message

Roy Bøhmer

Sunday 18 June 2006 2:21:38 pm

Hi!
I've made an extension, which (among other) sends email with content from a contentobject (xml-attribute). I've used the extension with success on a 3.6.1 installation, but on the current 3.7.3 it will not send email when there are linebreaks in the template(!!??). If I write everything in one line it sends without trouble.

Inserting the xml-attribute content (attribute_view_gui ..) causes the same problem. When outputing the content somewere else (not in mail) it all seems to be 100% perfect.

<b>Usefull info:</b>
Server runs LAMP php 4.4.2)
I develop on a Windows machine. I've tried saving template with linebreaks as lfcr (win) and lf (unix)
Mail is currently send via SMTP (because of some minor sendmail issues on server)

<b>Some code:</b>

$mail_tpl =& templateInit();
$mail_tpl->setVariable( 'settings_node', $settings_node );
$mailTemplateResult =& $mail_tpl->fetch( $mailTemplate ); //works. 

$confirmation_mail = new eZMail();
$confirmation_mail->setContentType( 'text/html', false, false, false );
(...)
$confirmation_mail->setBody( $mailTemplateResult ); // This is defenitly where the trouble shows
$mailResult = eZMailTransport::send( $confirmation_mail );

Any suggestion is highly appreciated!

Roy

Kristof Coomans

Monday 19 June 2006 12:05:57 am

Hi Roy

it will not send email

What's in $mailResult? Did you take a look in the SMTP server's log files?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

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:33
Script start
Timing: Jan 18 2025 11:20:33
Module start 'layout'
Timing: Jan 18 2025 11:20:33
Module start 'content'
Timing: Jan 18 2025 11:20:34
Module end 'content'
Timing: Jan 18 2025 11:20:34
Script end

Main resources:

Total runtime1.2051 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 589.1797152.6406
Module start 'layout' 0.00750.0028 741.820339.4922
Module start 'content' 0.01031.1931 781.3125526.7188
Module end 'content' 1.20340.0016 1,308.03138.1250
Script end 1.2051  1,316.1563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2920160.0002
Check MTime0.00130.1105160.0001
Mysql Total
Database connection0.00090.074310.0009
Mysqli_queries1.156195.9313540.0214
Looping result0.00050.0450520.0000
Template Total1.168697.020.5843
Template load0.00210.174320.0011
Template processing1.166596.796520.5832
Template load and register function0.00030.027610.0003
states
state_id_array0.00090.075310.0009
state_identifier_array0.00070.060720.0004
Override
Cache load0.00170.1390190.0001
Sytem overhead
Fetch class attribute can translate value0.00070.058020.0003
Fetch class attribute name0.00170.137630.0006
XML
Image XML parsing0.00050.044420.0003
class_abstraction
Instantiating content class attribute0.00000.000630.0000
General
dbfile0.00070.0621160.0000
String conversion0.00000.000740.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs