missing style in emails #389

Closed
opened 2026-10-04 23:56:05 +02:00 by adam · 6 comments
Owner

Since I updated Smarty to version 3.1.28 (for compatibility with PHP 7), emails have lost their style.

Since I updated Smarty to version 3.1.28 (for compatibility with PHP 7), emails have lost their style. <!-- github-sync-id:127930753 -->
adam closed this issue 2026-10-04 23:56:05 +02:00
Author
Owner

This is certainly the same problem @mistic100 fixed in 9cc816d364 and then in efbc08e537

We have to fix it in the latest version of Smarty too.

This is certainly the same problem @mistic100 fixed in 9cc816d364057828cecc26dc1432448a57f261e9 and then in efbc08e537e26dde5f1bd98de4f8608ad6e81501 We have to fix it in the latest version of Smarty too. <!-- github-comment-id:173578944 -->
Author
Owner

We should check what is the real impact of this and notify Smarty team.

We should check what is the real impact of this and notify Smarty team. <!-- github-comment-id:173925599 -->
Author
Owner

The strip is intended for html where removing all white space is intended and desired.
I used it first time for inlined javascript properly checking that it works. Others used it for css which is obviously broken.
I think that ideally :

  • strip should work as initially designed
  • we could add smarty blocks for minifying inline css and javascript based on css and js minifiers but this is going to be bad for performance (more php code loaded, lots of regex and js/css parsing would make the page be slower) ...
The strip is intended for html where removing all white space is intended and desired. I used it first time for inlined javascript properly checking that it works. Others used it for css which is obviously broken. I think that ideally : - strip should work as initially designed - we could add smarty blocks for minifying inline css and javascript based on css and js minifiers but this is going to be bad for performance (more php code loaded, lots of regex and js/css parsing would make the page be slower) ... <!-- github-comment-id:173935353 -->
Author
Owner

If the "problem" is only for "stripped" CSS in email templates (themes/default/template/mail/text/html/css), then I think we would just drop these {strip} instructions. Considering emogrifier will move CSS rules as inline attributes, {strip} is not really useful.

If the "problem" is only for "stripped" CSS in email templates (themes/default/template/mail/text/html/_css_), then I think we would just drop these {strip} instructions. Considering emogrifier will move CSS rules as inline attributes, {strip} is not really useful. <!-- github-comment-id:173946248 -->
Author
Owner

You are totally right. I think I added the {strip} tags in the early development of the new email templates, when I didn't know that webmailers require inline CSS.

You are totally right. I think I added the {strip} tags in the early development of the new email templates, when I didn't know that webmailers require inline CSS. <!-- github-comment-id:173979896 -->
Author
Owner

OK, I reverted the change on Smarty and removed the {strip} instruction for email CSS. See branch bug/405-css-emails

My test goes fine, I have style in emails.

OK, I reverted the change on Smarty and removed the {strip} instruction for email CSS. See branch bug/405-css-emails My test goes fine, I have style in emails. <!-- github-comment-id:174046797 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#389