-
Notifications
You must be signed in to change notification settings - Fork 826
Podcast player block: Add email rendering #45003
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
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
|
||
// Build the podcast player button content with Outlook 2021 compatibility | ||
$button_content = sprintf( | ||
'<a target="_blank" rel="noopener noreferrer" style="text-decoration: none;" href="%s"><div style="margin-bottom: 0; background-color: #f6f7f7; padding: 16px 24px; border-radius: 40px; border: 1px solid #AAA; font-size: 14px; mso-line-height-alt: 21.6px; line-height: 18px; font-weight: 400; font-family: Arial, Helvetica, sans-serif; text-align:center; letter-spacing: normal; margin-top: 0;"><div style="font-weight: 600; text-decoration: none; color: #000; line-height: 20px;"><img src="%s" style="display: inline-block; margin-right: 6px; vertical-align: middle;" width="18" height="18" /><div style="display: inline-block; vertical-align: middle;">%s</div></div></div></a>', |
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.
Although placing block elements inside an anchor is valid HTML, I've read that Outlook may sometimes render them incorrectly, flattening the structure and making the links unclickable. I don’t currently have a way to test this in Outlook to confirm whether that's truly the case, but might be safer to avoid it just in case.
On a separate note, I noticed that both visually and structurally, this button appears quite similar to the buttons used in the social icons core block - particularly the pill-shaped style that includes both an icon and text.

Do you think we could take a similar approach to render this block as well?
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.
I don’t currently have a way to test this in Outlook to confirm whether that's truly the case, but might be safer to avoid it just in case.
Good to know, thanks!
Do you think we could take a similar approach to render this block as well?
I'll take a look 👍
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.
Do you think we could take a similar approach to render this block as well?
That looks like the table format I was attempting, but the parts of the button that aren't the icon or text aren't linked. 🤔 Maybe that's a more acceptable tradeoff if the padding is smaller. I'll play around with it.
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.
1fb8d0b
to
b43bdfc
Compare
Fixes https://linear.app/a8c/issue/CML-821/add-email-rendering-for-podcast-player-blocks
Proposed changes:
Email client compatibility:
Here's how it renders for me in Gmail:
That's a smaller, pill-shaped table version of the current rendering, for better email client compatibility.
In Outlook 2021:

Dark mode:

Mobile:

Other information:
Jetpack product discussion
https://linear.app/a8c/project/switch-to-centralized-email-rendering-solution-aacb0b060431/overview
Does this pull request change what data or activity we track or use?
N/A
Testing instructions:
bin/jetpack-downloader test jetpack add/podcast-player-email-rendering
.wc-email-editor
sticker to a test site. See PCYsg-eQj-p2Notes: