Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • suzyb 474 posts 932 karma points
    Dec 19, 2017 @ 11:53
    suzyb
    0

    Single line comments being stripped out

    We have been using Newsletter Studio to send our a client's newsletter for several years. We recently redeveloped their site so are now using the new version of the package (v2.1.6) on an Umbraco 7.5.7 site.

    We have found however that single line comments (we use conditional comments to target specific clients) seem to be getting stripped out unless the comment has a line break. So for example this comment will be stripped out

    <!--[if mso]><p>hello outlook</p><![endif]-->
    

    but this one wont

    <!--[if mso]>
    <p>hello outlook</p>
    <![endif]-->
    

    This didn't happen on the old site which used version 1.4.4.1.

    Is there something in the newer version of Newsletter Studio that is stripping out single line comments.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Dec 19, 2017 @ 16:35
    Markus Johansson
    0

    Hi!

    Sorry to hear about your issue, I'll help you out!

    Do you have your templates stored as "Skins" or are you using the core-Templates in Umbraco?

    Is this on the first line or just in the middle of the template?

    Do you have any custom render tasks or so configured?

    // m

  • suzyb 474 posts 932 karma points
    Dec 19, 2017 @ 16:44
    suzyb
    0

    The template is stored as a skin. And we don't have any custom render tasks. It's a basic install of Newsletter Studio.

    I've added the skin I've been using for testing. The "content" is a single string of text in the RTE. When I send out an email using this skin any piece of content surrounded with in a comment with line breaks shows in outlook, the one without doesn't.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head>
    <head>
    <title>test</title>
    </head>
    <body>
    <!--[if mso]>
    <p>hello outlook 2007+</p>
    <![endif]-->
    <!--[if (gte mso 9)|(IE)]>
    <p>hello other outlook</p>
    <![endif]-->
    
    <!--[if mso]><p>this will get stripped out</p><![endif]-->
    
    <!--[if mso]>
    <p>this will not get stripped out</p>
    <![endif]-->
    
    [content]
    </body>
    </html>
    

    In the actual newsletter the comments are included throughout the email and all seem to be getting stripped out.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Dec 19, 2017 @ 16:56
    Markus Johansson
    0

    Hmm..

    I'm not really following along with where the issue is taking place.

    Do you send this trough a SMTP to a real address? Same setup as you had with the v1-version of the package?

    What if you send to a "fake smtp" like Papercut and look at the content of the email?

  • suzyb 474 posts 932 karma points
    Dec 19, 2017 @ 17:22
    suzyb
    0

    Hi Markus

    Yes, we've sent it through a SMTP server to a real address. The setup is exactly the same as it was with the old site as we've just uploaded it to the same server.

    When I tried using Papercut to intercept the email I get this as the message body

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head>
    
    <title>test</title>
    </head>
    <body>
    <!--[if mso]>
    <p>hello outlook 2007+</p>
    <![endif]-->
    <!--[if (gte mso 9)|(IE)]>
    <p>hello other outlook</p>
    <![endif]-->
    
    <!--[if mso]>
    <p>this will not get stripped out</p>
    <![endif]-->
    
    <p>this is some content in an email</p>
    
    </body></html>
    

    The single line comment is gone, so it does seem as though the email body isn't getting out of Umbraco fully intact.

    p.s. Thanks for pointing me in the direction of papercut. I was looking for something that could intercept the message.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Dec 19, 2017 @ 17:27
    Markus Johansson
    0

    Hi!

    Nice to hear that you liked Papercut =D I use it all the time =D

    Okey, strange issue, I'll have to look closer at this - I guess that you could have the line break as fix meanwhile?

    Sorry again for the inconvenience.

    // m

  • suzyb 474 posts 932 karma points
    Dec 19, 2017 @ 18:03
    suzyb
    0

    I'm hoping the client will be done with sending newsletters for the year :p but if not I'll make sure to include a line break in the comments.

    Thanks for your help on this Markus.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Dec 19, 2017 @ 19:49
    Markus Johansson
    0

    Hi again!

    I've managed to strip this down to the "PreMailer"-feature that was shipped a couple of versions ago. This feature basically inlines css as attributes on the elements. For some reason the premailer removes this the comment.

    I will file this as a bug and try to see if we can create an update to the premailer - if you would like to run without the premailer (v1 did not have it so if you have been fine so far you should be that now) you can comment out the last render task in /config/newsletterStudio.config.

      <task name="PreMailer" type="NewsletterStudio.Services.RenderTasks.Tasks.CssPremailerRenderTask, NewsletterStudio" />
    

    Hope this helps you - I'll ping this thread when there is an update that's relevant to this issue.

  • suzyb 474 posts 932 karma points
    Dec 19, 2017 @ 20:30
    suzyb
    0

    Thanks for looking into this Markus :)

    We'll switch off the PreMailer for now and await an update.

  • Markus Johansson 1938 posts 5866 karma points MVP 2x c-trib
    Feb 16, 2018 @ 16:18
    Markus Johansson
    0

    Hi!

    A fix for this is now included in the latest release 2.1.9.2.

    https://www.newsletterstudio.org/download/

    Hop that this solves your issues!

    // m

Please Sign in or register to post replies

Write your reply to:

Draft