Skip to content

Conversation

allilevine
Copy link
Member

@allilevine allilevine commented Aug 28, 2025

Fixes https://linear.app/a8c/issue/CML-821/add-email-rendering-for-podcast-player-blocks

Proposed changes:

  • Add email rendering to the podcast player block.
  • Add tests.

Email client compatibility:

Here's how it renders for me in Gmail:

Screenshot 2025-08-29 at 1 48 48 PM

That's a smaller, pill-shaped table version of the current rendering, for better email client compatibility.

In Outlook 2021:
Screenshot 2025-08-29 at 1 37 03 PM

Dark mode:
Screenshot 2025-08-29 at 1 50 22 PM

Mobile:
Screenshot 2025-08-29 at 1 50 33 PM

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

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:

  • Apply these changes to your sandbox using bin/jetpack-downloader test jetpack add/podcast-player-email-rendering.
  • Sandbox the API and turn on write access.
  • Add the wc-email-editor sticker to a test site. See PCYsg-eQj-p2
  • Create a post with a podcast player block. You can use https://feeds.acast.com/public/shows/67587e77c705e441797aff96
  • Send yourself a test email.
  • Click the podcast link in the email.

Notes:

  • To test with a WoA dev or self-hosted site you'll need to set it up to connect to your sandbox.
  • We don't apply any editor styles to the block (currently the case).

@allilevine allilevine self-assigned this Aug 28, 2025
Copy link
Contributor

github-actions bot commented Aug 28, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the add/podcast-player-email-rendering branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/podcast-player-email-rendering

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Block] Podcast Player [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Tests] Includes Tests labels Aug 28, 2025
Copy link
Contributor

github-actions bot commented Aug 28, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • 🔴 Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: September 2, 2025
    • Code freeze: September 1, 2025

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Aug 28, 2025
Copy link

jp-launch-control bot commented Aug 28, 2025

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/blocks/podcast-player/podcast-player.php 56/191 (29.32%) 29.32% 5 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@allilevine allilevine added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Aug 28, 2025
@allilevine allilevine marked this pull request as ready for review August 28, 2025 19:38
@allilevine allilevine requested review from a team, costasovo and yuliyan August 28, 2025 19:39

// 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>',
Copy link
Member

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.

R8p3v1V8flJCYQX2

Do you think we could take a similar approach to render this block as well?

Copy link
Member Author

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 👍

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to the pill-shaped table with some padding in the links. It's a compromise:

Gmail Outlook 2021
Screenshot 2025-08-29 at 1 47 20 PM Screenshot 2025-08-29 at 1 37 03 PM

@allilevine allilevine force-pushed the add/podcast-player-email-rendering branch from 1fb8d0b to b43bdfc Compare August 29, 2025 15:42
@allilevine allilevine merged commit 6fd0a19 into trunk Aug 29, 2025
67 checks passed
@allilevine allilevine deleted the add/podcast-player-email-rendering branch August 29, 2025 18:22
@github-actions github-actions bot removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Aug 29, 2025
@github-actions github-actions bot added this to the jetpack/15.0 milestone Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Podcast Player I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants