Style settings for the "Body background color" and "CSS" are always ignored when adding the template headers and footers in the _simplenews_template_mail_alter_simplenews_node() function.

For some reason, it only applies the settings if $message['body'] is null, but as far as I can tell, it'll never be null, especially since early on in the function, it gets the content from $message['body']['body'].

I attached a patch that removes the check, unless maybe someone can tell me why that's there?

CommentFileSizeAuthor
simplenews_template-css_fix.patch820 bytesdarktygur-1
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wuekkie’s picture

I applied your patch to to both the 2009-11-14 dev version and beta 3 but no love. I am using the color module with the pixture_reloaded template and all I am trying to do is change the link colors to MATCH what is on the site. Simplenews is being sent with the default color scheme of the theme. (which is girly pink btw, not so hot for a cub scout site) I'm not all that familiar with css, so maybe my css code stinks. Here's what I entered in the the style settings:

a:link {color: #0014a3;}
a:visited {color: #0014a3;}
a:hover {color: #0014a3;}
a:active {color: #0014a3;}

Everything looks great in preview, but test/actual emails are back to the default color scheme of the theme.

Thanks,
Wuekkie

darktygur-1’s picture

Emogrifier doesn't support 'pseudo selectors' (called pseudo-classes by the w3c spec). Try removing the :link, :visited, :hover, and :active, and just put a simple rule:
a {color: #0014a3;}

Wuekkie’s picture

Thanks, but I put emogrifier in and I don't think my server supports DOM.

darktygur-1’s picture

If you're using Mime Mail CSS Compressor, it runs Emogrifier whether or not you add it to Simplenews Template. I didn't mean to tell you to install it. I only mentioned it because it could cause your problem, and Simplenews Template isn't the only module that tries to use it.

I only meant to suggest that you change your css (simplify it to: a {color: #0014a3;}) and see if it fixes your problem. Can you try it? Also, try to View Source in your mail client and see if the css is even showing up there. It's possible for your mail client to simply be ignoring it.

Wuekkie’s picture

Of course I still tried it, I'm beating my head against the wall to make this work. I'm no CSS wiz, so I'll take all the help I can get. If the css wasn't getting through, would the links in the email still take the color of the links from the default color scheme of my color module enabled theme? Changing themes does change the color of the links in the simplenews message, but I can't get simplenews_template to affect it nor does the color module. Whether Simplenews_template is enabled or not, the result is always the same. For now, I've hacked the color settings in the style.css and for my theme so that the defaults match what I want simplenews to send out. I've got multiple newsletters, and simplenews_templete doesn't want to send anything out but the first template... it's really killing me. see this thread:

http://drupal.org/node/682566

Thanks,
Wuekkie

dan.crouthamel’s picture

Question - since it's sort of related and this thread is recent :) Is there an advantage to using CSS compressor versus Template & Emogrifier or vice versa? I've been playing around with this and noticed I was doing both, but now have it down to only using Emogrifier in template. My output looks the same. I'm assuming I don't need both, but was curious if one way was better than another. Thanks!

andrenoronha’s picture

i tried the patch... the CSS section still has no effect on the email...

i'm using simplenews template to output a header and a footer. both with some views. and nothing in the newsletter node body.

damiandab’s picture

same problem :(
css works in "preview", but has no effect in the mail view.