Skip to content

Forms: Add enableMailPoet attribute and toggle #44431

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

Merged
merged 5 commits into from
Jul 24, 2025

Conversation

edanzer
Copy link
Contributor

@edanzer edanzer commented Jul 23, 2025

Fixes FORMS-205

Proposed changes:

Note: MailPoet integration is behind a feature flag. See test instructions.

This adds the block interface needed to enable MailPoet integration on a per-form basis. I'm following the way this works for Jetpack CRM and Salesforce. Specific changes:

  • Adds a new connectMailPoet attribute to our forms
  • Exposes a toggle on the MailPoet integration card that toggles connectMailPoet on/off
  • When 'on' we display a MailPoet icon in the sidebar along with other active integrations
  • Adds a separate MailPoet icon with orange background that looks better and works with the style of our active integration icons
  • The value of connectMailPoet is added/saved as part of the block comment. In a separate PR, we'll add backend logic that uses this value, if true, to send contact details to MailPoet.

Screenshot
forms-enableMailPoet-toggle

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

None.

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

  • Enable the feature flag with: add_filter( 'jetpack_forms_mailpoet_enable', '__return_true' );
  • Add a form to page or post and open the integrations modal
  • If needed, install and activate MailPoet from the integrations modal, and add a MailPoet key.
    • Before this is done, the toggle on the header to enable MailPoet should be disabled
    • After this is all done, the toggle on the header to enable MailPoet should be enabled
  • Confirm that when you enable MailPoet via the toggle, the MailPoet icon is added to the list of active integrations in the sidebar.
  • Question: my understanding is we do not need to worry about block deprecations when adding an attribute that is only saved to the block comment. If anyone knows differently, please let me know.

@edanzer edanzer self-assigned this Jul 23, 2025
@edanzer edanzer added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. [Pri] Normal [Block] Contact Form Form block (also see Contact Form label) [Package] Forms labels Jul 23, 2025
Copy link
Contributor

github-actions bot commented Jul 23, 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/forms-enableMailPoet-attribute branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/forms-enableMailPoet-attribute

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

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!

@edanzer edanzer requested a review from a team July 23, 2025 16:24
Copy link

jp-launch-control bot commented Jul 23, 2025

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/forms/src/blocks/contact-form/components/jetpack-integrations-modal/active-integrations/index.js 0/22 (0.00%) 0.00% 3 ❤️‍🩹
projects/packages/forms/src/blocks/contact-form/components/jetpack-integrations-modal/mailpoet-card.tsx 0/5 (0.00%) 0.00% 1 ❤️‍🩹

1 file is newly checked for coverage.

File Coverage
projects/packages/forms/src/icons/mailpoet-orange.tsx 0/4 (0.00%) 💔

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@edanzer edanzer force-pushed the add/forms-enableMailPoet-attribute branch from 2dfca0c to f97ce7d Compare July 24, 2025 14:48
@edanzer edanzer merged commit 29ef216 into trunk Jul 24, 2025
64 of 65 checks passed
@edanzer edanzer deleted the add/forms-enableMailPoet-attribute branch July 24, 2025 19:27
@github-actions github-actions bot removed the [Status] Needs Review This PR is ready for review. label Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Contact Form Form block (also see Contact Form label) [Feature] Contact Form [Package] Forms [Pri] Normal [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant