I am using simplenews without hindrance on one of my sites. However, I'm experiencing a strange thing on a different site. I was investigating why a seemingly small newsletter was 170kb in size (where it should be more like 30kb). I discovered in the source of the email that just about all my drupal site's css is being embedded in the head tag. My theme's css, and even some module's stylesheets.
I am quite befuddled, as the operational newsletter on the one site is doing great, and certainly not embedded stuff where it shouldn't.
Can anyone steer me in a direction?
much appreciated
Teezi
Comments
Comment #1
sutharsan commentedThe direction is Mime Mail module settings.
Comment #2
Teezi commentedThanks for the tip, but there's nothing of use in the Mimemail settings. This newsletter needs to be HTML.
Comment #3
Teezi commentedStill need to find the reason for this happening....
Comment #4
Teezi commentedMy humblest apologies. The direction WAS Mimemail, after all. Seems the mimemail.tpl.php was the culprit. Fixed now.
Thanks!
Comment #5
sutharsan commentedCould this have been prevented with better documentation? Please help to improve, any suggestion is better than no suggestion.
Comment #6
michelleA setting would be nice. I am using Mime Mail with Simplenews because I want links to show up as linked text, not written out links. But I certainly don't want to cram all of my site's CSS into a newsletter. I see it can be changed with theming but this is really crying out for a checkbox on the settings page to include or not include the site's CSS and let more specific tailoring be done at the theme level from there.
Michelle
Comment #7
sgabe commentedThe attached patch provides the feature that Michelle described above.
I am changing version and category, since the development snapshot is older than the current alpha release (the patch applies to that) and this is rather a feature, than a support request.
Please review it and give feedback.
Comment #8
JGonzalez commentedThe patch works great for what is supposed to do.
Comment #9
AlexisWilke commentedActually, you can create an empty mail.css in your theme and it would reduce the style to nothing... or whatever you put in your mail.css file.
The problem with a flag is if you have 3 newsletters then all 3 are affected. There is an issue with that too though since it would be useful to have 3 different mail.css files assigned depending on the newsletter term... Hmmm...
Comment #10
wim leersReroll of the patch in #7. It indeed works great. What's the reason for not yet committing this?
@AlexisWilke: that's correct, but you can simply choose *not* to use that flag. This simple flag solves the problem for most users, thus it's an acceptable compromise for now.
Comment #11
michelleI agree with Wim Leers. If you have 3 newsletters and really need to get detailed, you can always fall back to the theming option. A setting works for people who just want to put a newsletter on their site and keep it simple.
Michelle
Comment #12
sgabe commented@Wim Leers: I want to kill most of the bugs and make sure the module is stable enough before implementing any new features, that's top priority now. However we are getting nearer and nearer to the point where we can add new features.
Comment #13
sgabe commentedAttaching a revised patch of #10.
Will go into HEAD.
Comment #14
AlexisWilke commentedsgabe,
I see that this patch checks whether the mail.css file exists. Not only that, it is a copy and paste of the code which uses:
I'm thinking that you want to write a function that tells you what the .css files are. A function that returns an array with all the .css filenames to be used with the current global $theme. Maybe with a flag to say that you only want to know whether there is a mail.css file.
Yet, the current theme (global $theme) may not be the one that is current when sending the email. So instead you should present a list of themes/flags to be correct.
Thank you.
Alexis
P.S. see also: #883284: Wrong theme selection in template_preprocess_mimemail_message() and #338460: Doens't look for mail.css in Zen subthemes: suggesting better integration with Zen theme
Comment #15
fmjrey commentedI don't know much about drupal/php/theming but it seems there could be some inspiration to be taken from ckeditor.module code:
The above code contains ckeditor's patch found in #818378: Not all css files are loaded.
With that patch ckeditor also uses Fusion css/local.css for styling text in the editor. The local.css file in Fusion is used to override styles so it's quite a big deal to not include it when the theme has been customized.
Right now Mimemail also ignores the file css/local.css in Fusion.
So with all these patches and code around, couldn't we find a final fix for this?
Comment #16
sgabe commented@fmjrey: Please, open a new issue for this.
Comment #17
fmjrey commentedCreated #920904: Fusion local.css not taken into account
Comment #18
sgabe commentedCommitted to HEAD with minor changes.