Results 1 to 9 of 9

Thread: Campaign email lost all style

  1. #1
    MLCrane is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    20

    Default Campaign email lost all style

    Here's a strange one... In 5.2.0a (yes, we've been slow to upgrade) we made an email campaign, set up a lovely template using valid HTML and CSS so that it looked identical in Thunderbird/Outlook/IE/FF and set a few tests using Emails to ensure everything was good. However, when we used the Campaign engine to send a test, all the recipient emails were devoid of their style!

    Looking at the source of one of the Campaign engine tests, every entry in the <style> tags at the top has been replaced with the tracker URL. Are we the only people for whom this is the case, and does anyone have any suggestions on how we can send out CSS styled HTML emails without having to individually style each tag?

    Code:
    <style>   A:link http://svn.ggpsystems.co.uk/crm/index.php?entryPoint=3Dca=
    mpaign_trackerv2&track=3Dc8f2e727-f3f6-96fc-f5a9-4a2ceec770d5&identifier=
    =3D34670b47-b7a8-9bdf-7e5c-4a3109e164d8   A:visited http://svn.ggpsystems.=
    co.uk/crm/index.php?entryPoint=3Dcampaign_trackerv2&track=3Dc8f2e727-f3f6-=
    96fc-f5a9-4a2ceec770d5&identifier=3D34670b47-b7a8-9bdf-7e5c-4a3109e164d8   =
    A:hover http://svn.ggpsystems.co.uk/crm/index.php?entryPoint=3Dcampaign_tr=
    ackerv2&track=3Dc8f2e727-f3f6-96fc-f5a9-4a2ceec770d5&identifier=3D34670b47=
    -b7a8-9bdf-7e5c-4a3109e164d8   LI http://svn.ggpsystems.co.uk/crm/index.ph=
    p?entryPoint=3Dcampaign_trackerv2&track=3Dc8f2e727-f3f6-96fc-f5a9-4a2ceec7=
    70d5&identifier=3D34670b47-b7a8-9bdf-7e5c-4a3109e164d8   P =
    http://svn.ggpsystems.co.uk/crm/index.php?entryPoint=3Dcampaign_trackerv2&=
    track=3Dc8f2e727-f3f6-96fc-f5a9-4a2ceec770d5&identifier=3D34670b47-b7a8-9b=
    df-7e5c-4a3109e164d8   .header
    http://svn.ggpsystems.co.uk/crm/index.php?entryPoint=3Dcampaign_trackerv2&=
    track=3Dc8f2e727-f3f6-96fc-f5a9-4a2ceec770d5&identifier=3D34670b47-b7a8-9b=
    df-7e5c-4a3109e164d8   .imageRepeatBox http://svn.ggpsystems.co.uk/crm/ind=
    ex.php?entryPoint=3Dcampaign_trackerv2&track=3Dc8f2e727-f3f6-96fc-f5a9-4a2=
    ceec770d5&identifier=3D34670b47-b7a8-9bdf-7e5c-4a3109e164d8   =
    .imageRepeatBox2 http://svn.ggpsystems.co.uk/crm/index.php?entryPoint=3Dca=
    mpaign_trackerv2&track=3Dc8f2e727-f3f6-96fc-f5a9-4a2ceec770d5&identifier=
    =3D34670b47-b7a8-9bdf-7e5c-4a3109e164d8 </style>
    (and sorry for the complete lack of "pagination" in the code, but that's what Sugar does to the carefully laid out code I built in NetBeans )

  2. #2
    MLCrane is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    20

    Default Re: Campaign email lost all style

    Just a quick FYI/update, I did the upgrade to 5.2.0e last night and it's all same-same.

    It came to me last night on the walk home, not thinking about the problem at all, that the problem is that the curly braces in the <style> block have been universally replaced. Could this be corrected inside of Sugar by making the campaign engine a little smarter so it ignores the whole of any <style> block?

    (Search for "</style>" and use the return value as the starting point for the replacing of "{...}" with tracker URLs... You can always proscribe in the documentation that the <style> block, if one is being used, must be at the top of the HTML "body")
    Last edited by MLCrane; 2009-06-12 at 09:54 AM.

  3. #3
    alifnoon is offline Member
    Join Date
    Jun 2009
    Posts
    15

    Default Re: Campaign email lost all style

    Quote Originally Posted by MLCrane View Post
    Just a quick FYI/update, I did the upgrade to 5.2.0e last night and it's all same-same.

    It came to me last night on the walk home, not thinking about the problem at all, that the problem is that the curly braces in the <style> block have been universally replaced. Could this be corrected inside of Sugar by making the campaign engine a little smarter so it ignores the whole of any <style> block?

    (Search for "</style>" and use the return value as the starting point for the replacing of "{...}" with tracker URLs... You can always proscribe in the documentation that the <style> block, if one is being used, must be at the top of the HTML "body")
    I have the exact same problem and just added a thread for it.

    What the heck is going on? If you find a solution please let me know.

    Looks like I wont be using Sugar's campaigns anytime soon! Hunh!

  4. #4
    MLCrane is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    20

    Default Re: Campaign email lost all style

    Well, I'm happy to have a go at kludging a fix for 5.2.X, if one of you that knows where to make such a fix can tell me which file does the campaign tracker rewriting?

  5. #5
    alifnoon is offline Member
    Join Date
    Jun 2009
    Posts
    15

    Default Re: Campaign email lost all style

    Quote Originally Posted by MLCrane View Post
    Well, I'm happy to have a go at kludging a fix for 5.2.X, if one of you that knows where to make such a fix can tell me which file does the campaign tracker rewriting?
    I have gone ahead and reported this thread as info on the bug in bug tracking System.

  6. #6
    alifnoon is offline Member
    Join Date
    Jun 2009
    Posts
    15

    Default Re: Campaign email lost all style

    Quote Originally Posted by alifnoon View Post
    I have gone ahead and reported this thread as info on the bug in bug tracking System.
    You might find this a bit of a good news!

    I cut the style Tags from my template and Pasted them atthe bottom. Wala, the Formatting was corrected in my test. Althought I don't think this is the best way, but anyway it works.

  7. #7
    MLCrane is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    20

    Default Re: Campaign email lost all style

    Quote Originally Posted by alifnoon View Post
    You might find this a bit of a good news!

    I cut the style Tags from my template and Pasted them atthe bottom. Wala, the Formatting was corrected in my test. Althought I don't think this is the best way, but anyway it works.
    alifnoon,

    I have to say at the start that I was sceptical when I read your message, but you're right. Transpose the style block to be the last thing in the html body, and it doesn't get mangled

    A work-around of the best order...

  8. #8
    mikesolomon is offline Sugar Community Member
    Join Date
    Feb 2008
    Location
    UK
    Posts
    1,467

    Default Re: Campaign email lost all style

    are you using tracker urls in your email?

    if so there is a bug that breaks the css

    To fix this edit modules/EmailTemplates/EmailTemplate.php

    At about line 323 Change

    $template_text=substr_replace($template_text,$trac ker_url,$matches[0][$i][1], strlen($matches[0][$i][0]));

    to

    if (!empty($tracked_urls[$url_key_name])) {
    $template_text=substr_replace($template_text,$trac ker_url,$matches[0][$i][1], strlen($matches[0][$i][0]));
    }
    Mike Solomon
    Development Manager
    Ivy Ltd
    www.ivy.ltd.uk]www.ivy.ltd.uk

    php version 5.2.6
    MySql 5.1.59

  9. #9
    barrybert is offline Senior Member
    Join Date
    May 2010
    Posts
    75

    Default Re: Campaign email lost all style

    I might find this a bit of a good news!



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Lost email panel - 5.1
    By philn in forum Help
    Replies: 0
    Last Post: 2008-12-08, 04:23 PM
  2. Converting targets, lost email
    By Gasparrini in forum Help
    Replies: 6
    Last Post: 2008-03-28, 01:08 PM
  3. Gmail style new email status + favicon change
    By badenochpty in forum Developer Help
    Replies: 1
    Last Post: 2008-03-17, 04:14 PM
  4. Replies: 0
    Last Post: 2007-02-14, 07:58 PM
  5. Support for inline style css in email templates
    By rschilke in forum Marketing/Campaign Management
    Replies: 2
    Last Post: 2006-08-24, 11:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •