2

i have issue regarding apply in line css in email template.

it's showing following error in my email template

CSS inlining error: Warning: DOMXPath::query(): Invalid expression in /var/www/magento2/public_html/vendor/pelago/emogrifier/Classes/Emogrifier.php on line 269 

i also update pelago reference link but no luck.

1

I got solution perfect solution, you need to update
https://magento.stackexchange.com/posts/201343/edit

/var/www/html/vendor/pelago/emogrifier/Classes/Emogrifier.php
Line 595,

 $search = array(
            // get rid of css comment code
            '/\\/\\*.*\\*\\//sU',
            // strip out any import directives
            '/^\\s*@import\\s[^;]+;/misU',
            // strip remains media enclosures
            '/^\\s*@media\\s[^{]+{(.*)}\\s*}\\s/misU',
            '/^\\s*@-?[A-Za-z-]+\\s[^{]+{(.*)}\\s*}\\s/misU',
        );

        $replace = array(
            '',
            '',
            '',
            '',
        ); 
0

found a solution for Magento 2

created the files

/web/css/email.less

and

/web/css/email-inline.less

in my custom theme and added the content from

/vendor/magento/theme-frontend-blank/web/css/email.less

and

/vendor/magento/theme-frontend-blank/web/css/email-inline.css respectively

Please Note below

but each with the line "@import 'source/_theme.less';" commented out (or removed)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.