-
Notifications
You must be signed in to change notification settings - Fork 843
Premium Content: add email rendering #46006
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
base: trunk
Are you sure you want to change the base?
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 3 files.
|
jeherve
left a comment
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'm most likely missing something in my set up, because I do not see the payment buttons in the emails at all, whether I test on a Jetpack site or a wpcom simple site.
I also noticed some oddities with colors and text alignment:
Editor
(centered italic text, buttons with custom colors from the theme palette, text with custom color, other text with color from the theme palette)
Email preview
| } | ||
|
|
||
| // Reuse the button block's email rendering method. | ||
| return \Automattic\Jetpack\Extensions\Button\render_email( $block_content, $button_block, $rendering_context ); |
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 think I would check if the class exists just to be sure, since Jetpack allows disabling the registration of some blocks via filters. Some users may have disabled the button block for some reason (although I would assume it would cause them trouble with the paid content buttons already).
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'm thinking we may want to place those in a new subdirectory, to avoid mixing them with regular block tests. It would be easier to locate them in the future, if we need mocks again.
Closes https://linear.app/a8c/issue/CML-1027/fix-premium-contentcontainer-email-render
Proposed changes:
email_render_callbackforjetpack/recurring-paymentsjetpack/payment-buttonsandpremium-content/containerOther information:
Jetpack product discussion
NA
Does this pull request change what data or activity we track or use?
No
Testing instructions:
This change needs to be pulled into WPCOM to test since emails and previews are generated from WPCOM. To test on different sites make sure your site is using your sandbox for the
public-api.wordpress.com.wc-email-editorsticker to your blog