Uploaded image for project: 'Runtime'
  1. Runtime
  2. RUNTIME-3441

Inline CSS in mail fails with a empty CSS rule

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 4.4.0, 4.3.6
    • Component/s: None
    • Labels:
      None

      Description

      When a newsletter template contains a empty CSS rule in <style> section like:

      #newsletter-sidebar1 .encart{
      }
      

      the following css rules are ignored because the selector and properties are inverted.

      This piece of code in SendMailHelper does not support empty rule:

      StringTokenizer st = new StringTokenizer(styleRules, "{}"); 
                  while (st.countTokens() > 1) 
                  { 
                      String selectors = st.nextToken();
                      String properties = st.nextToken();
      
                      String[] selector = selectors.split(",");
                      for (String s : selector)
                      {
                          if (StringUtils.isNotBlank(s))
                          {
                              rules.add(new CssRule(s.trim(), properties, rules.size()));
                          }
                      }
                  } 
      

      With a empty rule, the "properties" value is the next CSS rule instead of empty.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              laurence Laurence Aumeunier
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: