Skip to content

Conversation

allilevine
Copy link
Member

@allilevine allilevine commented Aug 28, 2025

Fixes https://linear.app/a8c/issue/CML-770/fix-subscribe-block
Fixes https://linear.app/a8c/issue/CML-860/fix-email-rendering-for-buttons

Proposed changes:

This PR adds email rendering for the Jetpack button block, using the core/button block email rendering already available in the WC Email Editor package. We then use the button block email rendering in the subscribe block. Also adds tests.

Known issue: the core button block rendering doesn't support gradients. We can follow up on that in the package.

Screenshot 2025-08-29 at 4 48 19 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/issues?layout=list&ordering=priority&grouping=workflowState&subGrouping=none&showCompletedIssues=all&showSubIssues=true&showTriageIssues=false

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/subscribe-block-wc-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 button block and a subscribe block. Try changing the button styles.
  • Send yourself a test email.
  • Click the buttons 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.

@allilevine allilevine self-assigned this Aug 28, 2025
@github-actions github-actions bot added [Block] Subscriptions [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

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/subscribe-block-wc-email-rendering branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/subscribe-block-wc-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

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:

No scheduled milestone found for this plugin.

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 2 files.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/blocks/button/button.php 18/204 (8.82%) 8.82% 27 💔
projects/plugins/jetpack/extensions/blocks/subscriptions/subscriptions.php 122/678 (17.99%) 3.53% 0 💚

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. .

@simison
Copy link
Member

simison commented Aug 29, 2025

A couple of thoughts:

  • Could the code delegate rendering to jetpack/button block, and then we can use the same email rendering to render buttons for all sorts of things like donations block, payment blocks, paywalls in emails, subscription block, jetpack forms, etc.
  • Alternatively, delegate to core/button which we should also support.

@allilevine
Copy link
Member Author

A couple of thoughts:

  • Could the code delegate rendering to jetpack/button block, and then we can use the same email rendering to render buttons for all sorts of things like donations block, payment blocks, paywalls in emails, subscription block, jetpack forms, etc.
  • Alternatively, delegate to core/button which we should also support.

I'll try it out, thanks for the suggestion! We do support core/button here.

@allilevine allilevine force-pushed the add/subscribe-block-wc-email-rendering branch from 59da532 to dd0e3c1 Compare August 29, 2025 18:32
@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 29, 2025
@allilevine allilevine changed the title Subscribe block: Add email rendering for WC Email Editor Subscribe and button blocks: Add email rendering for WC Email Editor Aug 29, 2025
@allilevine allilevine marked this pull request as ready for review August 29, 2025 22:17
@allilevine allilevine requested review from a team, costasovo and yuliyan August 29, 2025 22:17
Copy link
Member

@yuliyan yuliyan left a comment

Choose a reason for hiding this comment

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

The button and jetpack/subscriptions work pretty well overall - nice work! I just noticed a few minor styling issues and left comments on those.

@allilevine allilevine force-pushed the add/subscribe-block-wc-email-rendering branch from adf3ca9 to 68ce7ae Compare September 2, 2025 15:16
@allilevine allilevine requested a review from yuliyan September 2, 2025 16:36
@allilevine allilevine force-pushed the add/subscribe-block-wc-email-rendering branch from 610f685 to 930f395 Compare September 3, 2025 16:04
@allilevine allilevine merged commit bc9ef4c into trunk Sep 3, 2025
65 checks passed
@allilevine allilevine deleted the add/subscribe-block-wc-email-rendering branch September 3, 2025 18:15
@github-actions github-actions bot removed [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Sep 3, 2025
kangzj pushed a commit that referenced this pull request Sep 4, 2025
…45006)

* Subscribe and button blocks: Add WC email rendering.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Button [Block] Subscriptions 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.

3 participants