I am using Simplenews with Mimemail and trying to send HTML formatted emails, All seems to work except that the email are center aligned.
I see form the email header the following which is what I think is my problem.
Where do I change this.
text-align:center;margin:40px020px0;'>
Online Survey
| Comment | File | Size | Author |
|---|---|---|---|
| EmailHeader.txt | 7.89 KB | gordon.waters |
Comments
Comment #1
tallsimon commentedi have the same problem. where does it take this style from?
Comment #2
Carl242 commentedSam problem here. Using simplenews with mimemail. I can't figure out where that text-aligh:center comes from
Comment #3
Carl242 commentedI think I might be onto something here: how many of you are using Marinelli or sub-theme based on it? I have found the following code in style.css inside the Marinelli theme folder
and the following code inside the mimemail.tpl.php file inside /modules/mimemail/theme
To me this looks like it is calling the "body" style, but for some reason the "body" style is centered in the Marinelli css file. I'm going to do some testing to prove this by making a "mail" style that is not centred and then changing the tpl.php file to call the "mail" style instead. FYI I already tried commenting out "the "div id="center"" and that did nothing. I will update this thread with my findings.
Comment #4
poehnix commentedI am using a marinelli subtheme too. A quick test putting an empty mail.css in the theme folder does not seem to solve the issue.
(No css/js compression)
Comment #5
tallsimon commentedThank you carl242, you are correct! I was using marinelli, and changing this setting seemed to work. for reference for others:
from marinelli theme style:
i copied and pasted the necessary part into my sub-theme, editing the alignment. therefore added to my sub-theme style.css:
Importantly, I then flushed the caches (admin menu makes this easy!!) and hey presto, a test message was left-aligned.
Another triumph of the drupal community's joint problem-solving!
Comment #6
poehnix commentedThe problem with tallsimon solution is theme css editing is needed, which is not a good thing. A tpl override or adding an empty css file would be better
Comment #7
mtpultz commentedAre you guys able to get html emails in hotmail or does Mimemail not sending the newsletter in the proper format?
Comment #8
Carl242 commentedWell Talismon that was one way to go about it . . . but I found that the Marinelli theme's templates were really complex and it was a bit beyond me to get EVERYTHING to work (including space btw paragraphs and getting lists to format correctly). Instead, I found something of use in the following issue:
http://drupal.org/node/614782
Basically it said to create a custom mail.css inside your theme directory (in my case gnifetti) and to copy the mimemail.tpl.php file there. I used a blank .css file and got exactly what I wanted, but I can see this might be an easier way to get all the formatting you want in your html mails and only that (instead of the email being like 200k large). Hope that helps :)
Comment #9
gordon.waters commentedI have tried a few of these but nothing seems to left align my HTML mail, has anyone got any further with this. I am using Aboutpeople as my theme. The problem is with HTML formatted mail.
Gordon
Comment #10
sgabe commented@gordon.waters: As Carl242 wrote before, you have too a text-align:center; property assigned to the body element.
When MimeMail doesn't find a mail.css, gathers all style sheets from your site and uses those for the e-mails.
You need to do one of the following to fix the problem:
Comment #11
gordon.waters commented@sgabe Thanks for the update, on initial testing the mail.css options seems to work, but I need to do a little more testing which I will be doing today.
Comment #12
sgabe commented@gordon.waters: No activity, so I assume you have found the solution to your problem and I am closing this.
Comment #13
itserich commentedFor the benefit of anyone else who barely knows what we are doing...
I was receiving email with centered text in D7. The solution was go to:
admin/config/system/mimemailand Unclick Include Site Style Sheets.