Add support for mail.css

Created on 22 March 2017, over 7 years ago
Updated 11 September 2024, about 1 month ago

The D7 version supported adding a file named "mail.css" to the theme, if found it was added during delivery. It would be useful to support this with the D8 version too.

πŸ“Œ Task
Status

Active

Version

2.0

Component

Theming

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡­πŸ‡·Croatia portulaca

    @liquidcms it's not working for me, I get a WSOD when I try to send an example mimemail and this in the log:

    Error: Class "LanguageInterface" not found in mytheme_preprocess_mimemail_message() (line 41 of /var/www/html/name/web/themes/custom/mytheme/mytheme.theme)
    …

  • πŸ‡¬πŸ‡§United Kingdom rivimey

    @portulaca It sounds like you need a 'use' statement for LanguageInterface in the file that you have added the code from #10 to. I can't recall the exact place but something of the form:

    use \Drupal\Core\...\...\LanguageInterface;

    Search existing code for examples.

  • πŸ‡­πŸ‡·Croatia portulaca

    @rivimey thank you!

    It's

    use Drupal\Core\Language\LanguageInterface;
    use Drupal\Core\Url;
    

    It's working now, although I'm getting a double slash in the CSS link path https://example.com//themes/custom/…

    Should the variable be without it?

    $variables['mail_css'] = $base_path . 'themes/custom/my_theme/css/mail.css';
    
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    @malcomio: Are you planning on working on this issue?

  • πŸ‡¬πŸ‡§United Kingdom malcomio

    In the project where we're using mimemail, we ended up adding a preprocess in our theme, as suggested in #10, and I haven't had a chance to make progress on a contributed version.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
Production build 0.71.5 2024