[ZendTo] Re: Small but annoying formatting errors in templates/dropoff_email.tpl

Jules Jules at Zend.To
Mon Feb 25 10:43:18 GMT 2013


On 22/02/2013 17:23, Mike Brudenell wrote:
> Greetings -
>
> There are a number of small but annoying problems with the content of 
> templates/dropoff_email.tpl file that I've been wrestling into submission.
>
> Most stem from stray spaces at the end of lines. Sounds daft I know, 
> but the message is composed and sent as "format-flowed", which tells 
> the recipient's email program to look for any lines ending 
> "space<CR><LF>" and join them with the next then reflow the result.
>
> This means that some on the lines of the dropoff email join onto 
> previous ones and look weird.
>
> To fix edit the standard config/dropoff_email.tpl as follows:
>
>   * Line 2: (after the line beginning "This is an..."
>     Delete all the spaces that are present on this meant-to-be-blank line.
>
Done. Will be in the next release.
>
>  *
>
>
>   * Line 9:
>     Says "If you wish to contact the sender, just reply to this
>     email." but our messages get sent out from a "do-not-reply"
>     address as set with EmailSenderAddress in conf/zendto.conf. I
>     think I read recently that ZendTo no longer forges the sender's
>     email address for messages it sends out, so presumably this
>     statement should no longer be present?
>
No, if you check an email sent by it, it should be setting the 
"Reply-To:" header which overrides the "From:" address when a recipient 
thumps "Reply".
>
>  *
>
>
>   * Line 27: (the one before the line beginning "-- File..."
>     Delete all the spaces that are present on this meant-to-be-blank line.
>
Done. Will be in the next release.
>
>  *
>
>
>   * Line 31: (The "Description" of a file)
>     When no description text is entered then this leaves the message's
>     line ending with "space<CR><LF>", which causes the next line
>     (Size) to be joined to the Description line and reflowed. A (not
>     ideal) fix is to change
>     Description:     {$f.description}
>     to
>     Description:     {if $f.description ne
>     ""}"{$f.description}"{else}(None){/if}.
>
>     Note: the final ".", seems to be needed to stop the parser from
>     swallowing the newline after the "{/if}" and joining with the next
>     line anyway.
>
> I wish I could improve on the final edit to avoid the need for the 
> final "." but I'm not familiar enough with the idiosyncrasies of 
> whatever parses the templates. Any offers...? :-)
I'll take a look at this. From a quick bit of Googling, it appears to be 
a bit of a known problem in Smarty, as it was designed to handle HTML 
files primarily, and has a rule that if the Smart code in {} produced 
some output, the following whitespace is left alone, but if it produced 
no output then it is swallowed.
"tags that don't have output swallow a following newline but tags that 
have output keep it." from
http://www.smarty.net/forums/viewtopic.php?p=12960

The better way would be to replace the value of $f.description in the 
PHP code with the string "(None)" and allow you to insert translations 
as necessary. i.e. make it a zendto.conf string.

Sound good?

Jules.

>
> Cheers,
> Mike B-)
>
> -- 
> IT Services, The University of York, Heslington, York YO10 5DD, UK
> Tel: +44-1904-323811
> Disclaimer: <http://www.york.ac.uk/docs/disclaimer/email.htm>
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto
>
> Jules
>
> -- 
> Julian Field MEng MBCS CITP CEng
>
> 'Science is an integral part of culture. It's not this foreign
>   thing, done by an arcane priesthood. It's one of the glories of
>   human intellectual tradition.' - Stephen Jay Gould
>
> www.Zend.To
> Twitter: @JulesFM
> PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20130225/b299d193/attachment.html 


More information about the ZendTo mailing list