I have mail.css in my theme dir (tried root and /css folder, even added to .info). Webform is seto to HTML email, Mail System is set to MimeMailSystem. Theme to render the emails is set to my custom theme (Bootstrap's sub-theme).

The webform email settings page is set to Send as HTML.

There is no CSS applied in the sent emails. I have the Mime Mail CSS Compressor (mimemail_compress) enabled.

Also the Include site style sheets is greyed out.

I copied the mimemail-message.tpl.php to my theme's templates and added some custom text to it to see if it works, and it does.
I even tried to add some custom

in the region, but the email source doesn't contain any when delivered.

I read the docu it says simply:

Email messages are formatted using the mimemail-message.tpl.php template.
  This includes a CSS style sheet and uses an HTML version of the text.
  The included CSS is either:
    the mail.css file found anywhere in your theme folder or
    the combined CSS style sheets of your theme if enabled.

But I can't get to work none of this. It doesn't find my mail.css

additional:
Also I noticed it doesn't render links, the default webform token included is <p>[submission:url]</p> and MIME rendered email shows it as plain text, although Mime Settings are set to Full HTML with Convert URLs to Links ticked.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vibrasphere created an issue. See original summary.

vibrasphere’s picture

Issue summary: View changes
caspervoogt’s picture

Same here, except for me 'Include site style sheets' is not greyed out; I can select or unselect it. I have tried it both ways. I have tried adding custom text to mimemail-message.tpl.php in my theme, and I have set Mimemail to use my theme... but it does not pick up my TPL. I don't even really need a TPL ... I was hoping to add my CSS in

there (since CSS is not loading) but this doesn't work either. I have tried with mimemail_compress enabled and disabled - made no difference.
caspervoogt’s picture

I updated to 7.x-1.1 and the issue remains on my end. Now, however, at admin/config/system/mimemail I can no longer tick the 'Include site style sheets' checkbox; it is disabled. I have mail.css in my theme's css folder and in the theme's root. At admin/config/system/mailsystem I have it set to use my theme.

I am wondering if this is working for anyone.. and if so, maybe someone can chime in here.

vibrasphere’s picture

I ended up including inline/internal CSS styles in my message field together with the rest of the email body in the Rules for emails that gets sent. It works.

caspervoogt’s picture

Hi vibrasphere. That's a good idea as a workaround - thank you.

I tried adding a

block in my email template (see attached screenshot) but that didn't do anything for me. Also, the site I'm working on has many dozens of forms, which would make this a fairly tedious workaround. I'd love to get this working with mail.css, but that does not appear to work. I'm changing this from Support Request to Bug.
caspervoogt’s picture

Category: Support request » Bug report
caspervoogt’s picture

What got it working for me was to edit the Mailsystem config at admin/config/system/mailsystem and set both "Site-wide default MailSystemInterface class" and "Mime Mail module class" to MimeMailSystem. Previously I had "Site-wide default MailSystemInterface class" set to SMTP and "Mime Mail module class" set to MimeMailSystem.

Additionally, I enabled the Mime Mail CSS Compressor submodule, which converts CSS from my theme into inline CSS. It reads my mail.css inside my theme's css folder, and converts it to inline CSS.

caspervoogt’s picture

Category: Bug report » Support request
philsward’s picture

When using "Rules Scheduler", the first thought is to place the mail.css in the admin theme because when you execute the rule manually, it uses the the theme of the logged in user. However, Rules Scheduler runs as "anonymous", so you need to figure out which theme is being presented to the anonymous user and place the CSS inside that theme folder.