Forms: Add mark as spam link to response email
Fixes FORMS-61 Follow-up to https://github.com/Automattic/jetpack/pull/43834 and needs to be rebased after it is merged
Proposed changes:
- Adds a way for an administrator to mark a response as spam from a link
- Adds the "mark as spam" link to the email sent after submission
- Adds a confirmation dialog before proceeding to prevent unintended status modifications
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
Does this pull request change what data or activity we track or use?
Testing instructions:
- In a site where you receive emails after form submissions, submit a response to a form
- Check that the email now has another link: "Mark as spam"
- Click on the this link
- Check that the "mark_as_spam" query param disappears
- Check that you see a confirmation dialog
- Cancel it
- Check that no change was made
- Click on the email link again
- This time, confirm it
- Check that you are sent to the Spam tab, where the response is pre-selected
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Review, ...).
- :white_check_mark: Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: 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 :robot:
Follow this PR Review Process:
- Ensure all required checks appearing at the bottom of this PR are passing.
- Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
- You can use GitHub's Reviewers functionality to request a review.
- 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!
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
update/forms-email-mark-as-spam-linkbranch. - To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-email-mark-as-spam-link
Interested in more tips and information?
- In your local development environment, use the
jetpack rsynccommand 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
Code Coverage Summary
Coverage changed in 2 files.
| File | Coverage | Δ% | Δ Uncovered |
|---|---|---|---|
| projects/packages/forms/src/dashboard/inbox/response.js | 0/63 (0.00%) | 0.00% | 1 ❤️🩹 |
| projects/packages/forms/src/contact-form/class-contact-form.php | 580/976 (59.43%) | 0.29% | 0 💚 |
1 file is newly checked for coverage.
| File | Coverage |
|---|---|
| projects/packages/forms/src/dashboard/hooks/use-mark-as-spam.ts | 0/15 (0.00%) 💔 |
Full summary · PHP report · JS report
Coverage check overridden by https://github.com/Automattic/jetpack/labels/I%20don%27t%20care%20about%20code%20coverage%20for%20this%20PR.