New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix custom styles for emails in preview and in sent messages #7595
base: trunk
Are you sure you want to change the base?
Conversation
Test the previous changes of this PR with WordPress Playground. |
* @param array $placeholders The placeholders. | ||
* | ||
* @return string | ||
*/ | ||
private function replace_placeholders( string $string, array $placeholders ): string { | ||
private function replace_placeholders( string $content, array $placeholders ): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPCS was complaining for the variable name.
Test the previous changes of this PR with WordPress Playground. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Imran92 Thanks for testing! Could you tell me what are the versions of WordPress and Gutenberg (if installed), and what theme do you use on the test website? |
I've tested it and the colors worked, but the alignment didn't. The result was the same with and without the Gutenberg plugin. |
Hi @merkushin 👋 I've shared the creds of a JN site where I reproduced the issue in DM. Hope it'll help! Thanks! Locally I didn't have GB installed and WP version was 6.5.2 |
4b886be
to
be0c332
Compare
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
Test the previous changes of this PR with WordPress Playground. |
As Imran suggested, I checked that when we don't use default colors and the picker instead we get colors as the HEX value, so I disabled default colors in the editor settings. With alignment is a bit harder. I added classes needed we missed in CSS, now it works in Preview and in Mail app. But Gmail webapp "doesn't work". I found they just don't support some CSS properties (for example, I also added styles to make text alignment work. I still see other issues with styles in emails:
And I suppose we can find even more tiny issues like those ones. I think we need to add a warning to our documentation that not all styles are supported in emails. And maybe list the ones we know already. |
Test the previous changes of this PR with WordPress Playground. |
Resolves #7459
The changes appear in HTML as has-pale-blue-something class for the element. This classes are defined in the global styles.
Proposed Changes
Testing Instructions
Screenshots
Real email:
(You can see that Sensei logo is not displayed — that's because it refers to my local website.)
Editor:
Preview:
Pre-Merge Checklist