Skip to content
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

Domains: Implement multi-target email forwards #98837

Open
wants to merge 43 commits into
base: trunk
Choose a base branch
from

Conversation

alshakero
Copy link
Member

@alshakero alshakero commented Jan 23, 2025

Requires https://github.a8c.com/Automattic/wpcom/pull/171065

Related to #98801

Proposed Changes

This implements the ability to add multiple email forwards for a single mailbox. It allows up to 5 addresses per mailbox.

Why are these changes being made?

See: p58i-jdB-p2

Testing Instructions

Testing under Upgrades > Emails

  1. Scroll to the bottom and add "Add new email forwards".
  2. In this form, enter the mailbox.
  3. Try your best to break it
  • Use a source that already reached the limit
  • Use a duplicated target.
  • Use bad characters.
  • Use @ in the source.

Validation

  1. Enter two duplicate emails, the second one should be rejected.
  2. Enter an incorrect email, it should be rejected.
  3. Enter four correct emails. Use rational addresses like you+one@gmail.com, you+two@gmail.com, ... Use emails you can access.
  4. Add them.
  5. Try to add more to the same source mailbox. You should be allowed to add one more, do that.
  6. Try to add more to the same mailbox. You shouldn't be allowed at all.
  7. Try to add a target email that shares the same domain as the source. You shouldn't be able to.

Deletion

  1. Delete one of them. It should be deleted, and all others should remain.

Verification

  1. Sandbox wordpress.com and www.wordpress.com.
  2. Visit your email and click the link. Only the one you verified should be verified.
  3. Add another forward for another mailbox (source address) but to the same target address. It should be already verified.
  4. When any of the addresses in the mailbox requires verification, a red bar should appear on the mailbox.

Testing under /sites > Domains > Email (Tab)

Repeat all the above. The only difference, is that "Add mailbox" is on top now.

Testing under Hosting settings

Repeat all the above. The only difference, is that "Add mailbox" is on top now.

URL: /overview/site-domain/email/DOMAIN/DOMAIN

Regression testing (important)

  1. Make two sites with paid domains. For your own sanity, include the word "titan" in the first domain, and "forward" in the second domain.
  2. In the site with Titan, go to My Home > Mailboxes > add one mailbox "Professional Email".
  3. In the site with Forward, go to my Home > Upgrades > Emails.
  4. Both UIs should look great. And only Email forward UI should group emails by source.

@matticbot
Copy link
Contributor

matticbot commented Jan 23, 2025

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~1603 bytes removed 📉 [gzipped])

name                   parsed_size           gzip_size
entry-main                 +4436 B  (+0.2%)     -267 B  (-0.0%)
entry-domains-landing       -682 B  (-0.1%)     -302 B  (-0.1%)
entry-browsehappy           -682 B  (-0.3%)     -302 B  (-0.5%)
entry-stepper               -568 B  (-0.0%)     -415 B  (-0.1%)
entry-login                 -506 B  (-0.0%)     -322 B  (-0.1%)
entry-subscriptions         -361 B  (-0.0%)    -1525 B  (-0.3%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~22828 bytes removed 📉 [gzipped])

name                                parsed_size            gzip_size
email                                 +194717 B  (+25.4%)   +64329 B  (+28.9%)
domains                                +18870 B   (+0.9%)    +6028 B   (+1.0%)
hosting                                +13532 B   (+0.5%)    +4506 B   (+0.6%)
signup                                  +1232 B   (+0.4%)      +48 B   (+0.1%)
link-in-bio-tld-flow                    +1165 B   (+0.1%)      +46 B   (+0.0%)
update-design-flow                      +1050 B   (+0.1%)     +620 B   (+0.1%)
a8c-for-agencies-client                  -893 B   (-0.1%)      -60 B   (-0.0%)
copy-site-flow                           -571 B   (-0.1%)      +91 B   (+0.0%)
home                                     -491 B   (-0.0%)      +70 B   (+0.0%)
promote-post-i2                          -489 B   (-0.1%)      -72 B   (-0.0%)
account                                  +457 B   (+0.1%)      +16 B   (+0.0%)
hundred-year-plan                        -438 B   (-0.2%)      -37 B   (-0.1%)
a8c-for-agencies-purchases               -412 B   (-0.1%)     -115 B   (-0.0%)
settings-security                        -409 B   (-0.1%)     +311 B   (+0.2%)
a8c-for-agencies-settings                -386 B   (-0.2%)      -33 B   (-0.0%)
a8c-for-agencies-agency-tier             -386 B   (-0.2%)      -37 B   (-0.1%)
posts                                    -385 B   (-0.1%)      -27 B   (-0.0%)
plugins                                  +366 B   (+0.0%)     +497 B   (+0.1%)
jetpack-connect                          -334 B   (-0.0%)     -188 B   (-0.1%)
settings-newsletter                      -332 B   (-0.1%)      +97 B   (+0.1%)
jetpack-cloud-plugin-management          +328 B   (+0.0%)     +552 B   (+0.1%)
a8c-for-agencies-plugins                 +328 B   (+0.0%)     +559 B   (+0.1%)
site-purchases                           -323 B   (-0.0%)     +462 B   (+0.1%)
settings-writing                         -319 B   (-0.1%)     +624 B   (+0.4%)
gutenberg-editor                         -311 B   (-0.1%)      -60 B   (-0.0%)
purchases                                -307 B   (-0.0%)     +757 B   (+0.1%)
jetpack-social                           -296 B   (-0.0%)     -593 B   (-0.3%)
settings-reading                         -283 B   (-0.1%)     -327 B   (-0.3%)
migrate                                  -283 B   (-0.1%)      -39 B   (-0.0%)
checkout                                 -283 B   (-0.0%)     +578 B   (+0.1%)
scan                                     -281 B   (-0.0%)      -63 B   (-0.0%)
a8c-for-agencies-signup                  -268 B   (-0.2%)     -147 B   (-0.3%)
github-deployments                       -256 B   (-0.0%)     +562 B   (+0.1%)
a8c-for-agencies-partner-directory       -255 B   (-0.0%)     +378 B   (+0.2%)
plans                                    -229 B   (-0.0%)      +98 B   (+0.0%)
devdocs                                  +226 B   (+0.1%)      -27 B   (-0.0%)
sites-dashboard                          +225 B   (+0.0%)     +630 B   (+0.2%)
settings-podcast                         -220 B   (-0.0%)      +13 B   (+0.0%)
jetpack-cloud-settings                   -214 B   (-0.0%)     +382 B   (+0.2%)
transferring-hosted-site-flow            -208 B   (-0.1%)      -20 B   (-0.0%)
security                                 -208 B   (-0.0%)     -528 B   (-0.2%)
performance-profiler                     -208 B   (-0.1%)       +9 B   (+0.0%)
a8c-for-agencies-landing                 -208 B   (-0.1%)       -9 B   (-0.0%)
a8c-for-agencies                         -208 B   (-0.2%)     -213 B   (-0.6%)
subscribers                              -205 B   (-0.0%)     -651 B   (-0.2%)
earn                                     -205 B   (-0.0%)      -28 B   (-0.0%)
jetpack-cloud-pricing                    -203 B   (-0.0%)      -64 B   (-0.0%)
woocommerce                              -178 B   (-0.1%)      -30 B   (-0.0%)
preview                                  -178 B   (-0.1%)      -44 B   (-0.0%)
posts-custom                             -178 B   (-0.0%)     -125 B   (-0.1%)
pages                                    -178 B   (-0.0%)      -42 B   (-0.0%)
marketplace                              -178 B   (-0.0%)      -30 B   (-0.0%)
jetpack-search                           -178 B   (-0.0%)      -30 B   (-0.0%)
jetpack-cloud-features-comparison        -178 B   (-0.0%)      -32 B   (-0.0%)
incoming-redirect                        -178 B   (-0.7%)      -27 B   (-0.3%)
google-my-business                       -178 B   (-0.0%)      -30 B   (-0.0%)
export                                   -178 B   (-0.1%)      -32 B   (-0.0%)
customize                                -178 B   (-0.1%)      -30 B   (-0.0%)
concierge                                -178 B   (-0.0%)      -30 B   (-0.0%)
add-ons                                  -178 B   (-0.1%)      -30 B   (-0.0%)
site-marketing                           -177 B   (-0.0%)     +629 B   (+0.1%)
themes                                   +165 B   (+0.0%)     +430 B   (+0.1%)
account-close                            -154 B   (-0.0%)     -441 B   (-0.3%)
settings-jetpack                         -151 B   (-0.0%)     +747 B   (+0.5%)
privacy                                  +147 B   (+0.0%)     +233 B   (+0.1%)
developer                                +147 B   (+0.0%)     +197 B   (+0.1%)
a8c-for-agencies-team                    -139 B   (-0.0%)      -78 B   (-0.0%)
a8c-for-agencies-referrals               -139 B   (-0.0%)      -87 B   (-0.0%)
a8c-for-agencies-overview                -139 B   (-0.0%)     -120 B   (-0.0%)
a8c-for-agencies-migrations              -139 B   (-0.0%)      -81 B   (-0.0%)
plugin-bundle-flow                       -129 B   (-0.0%)      +55 B   (+0.0%)
comments                                 -126 B   (-0.0%)      -33 B   (-0.0%)
media                                    -123 B   (-0.0%)     +684 B   (+0.2%)
stats                                    -116 B   (-0.0%)      -29 B   (-0.0%)
jetpack-cloud-partner-portal             -114 B   (-0.0%)      -77 B   (-0.0%)
a8c-for-agencies-marketplace             -113 B   (-0.0%)     +725 B   (+0.3%)
site-tools                               -112 B   (-0.0%)     +618 B   (+0.1%)
site-performance                         -112 B   (-0.0%)     +637 B   (+0.1%)
site-monitoring                          -112 B   (-0.0%)     +799 B   (+0.2%)
site-logs                                -112 B   (-0.0%)     +662 B   (+0.2%)
design-first-flow                        -110 B   (-0.4%)      -27 B   (-0.5%)
start-writing-flow                       -109 B   (-0.4%)      -24 B   (-0.4%)
site-settings                            +109 B   (+0.0%)     +540 B   (+0.1%)
onboarding-flow                          +108 B   (+0.1%)      +12 B   (+0.0%)
new-hosted-site-flow-user-included       +108 B   (+0.1%)      +10 B   (+0.0%)
connect-domain                           +108 B   (+0.1%)      +12 B   (+0.0%)
reblogging-flow                          +107 B   (+1.4%)       +8 B   (+0.4%)
newsletter-flow                          +107 B   (+0.5%)       +5 B   (+0.1%)
new-hosted-site-flow                     +107 B   (+0.1%)       +6 B   (+0.0%)
site-profiler                            -103 B   (-0.0%)      -11 B   (-0.0%)
people                                   -100 B   (-0.0%)      +66 B   (+0.0%)
marketing                                -100 B   (-0.0%)      +12 B   (+0.0%)
import                                   -100 B   (-0.0%)      -24 B   (-0.0%)
backup                                    -98 B   (-0.0%)     +271 B   (+0.1%)
a8c-for-agencies-sites                    -97 B   (-0.0%)     +368 B   (+0.1%)
settings-performance                      +95 B   (+0.0%)     +503 B   (+0.3%)
notification-settings                     +94 B   (+0.0%)     +384 B   (+0.2%)
patterns                                  -90 B   (-0.0%)      +12 B   (+0.0%)
hosting-features                          -86 B   (-0.0%)     +468 B   (+0.1%)
write-flow                                +78 B   (+0.0%)      +13 B   (+0.0%)
build-flow                                +78 B   (+0.0%)       +4 B   (+0.0%)
jetpack-cloud-agency-dashboard            +77 B   (+0.0%)      -67 B   (-0.0%)
jetpack-cloud-overview                    -75 B   (-0.0%)      -39 B   (-0.0%)
jetpack-cloud                             -75 B   (-0.0%)      +31 B   (+0.0%)
me                                        -74 B   (-0.0%)     -276 B   (-0.2%)
jetpack-app                               +67 B   (+0.0%)     +474 B   (+0.3%)
switch-site                               -66 B   (-0.0%)      +77 B   (+0.1%)
reader                                    +66 B   (+0.0%)     +495 B   (+0.1%)
help                                      +55 B   (+0.0%)     -203 B   (-0.1%)
site-blocks                               +42 B   (+0.0%)     -260 B   (-0.2%)
settings                                  +39 B   (+0.0%)     +474 B   (+0.2%)
theme                                     +31 B   (+0.0%)     +417 B   (+0.2%)
import-hosted-site-flow                   -27 B   (-0.0%)       +0 B
woocommerce-installation                  +17 B   (+0.0%)     +681 B   (+0.7%)
jetpack-cloud-agency-signup               -13 B   (-0.0%)       +9 B   (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~16733 bytes added 📈 [gzipped])

name                                                                              parsed_size           gzip_size
async-load-design-blocks                                                               +730 B  (+0.0%)     +117 B  (+0.0%)
async-load-calypso-my-sites-checkout-modal                                             -631 B  (-0.0%)     -280 B  (-0.1%)
async-load-automattic-help-center                                                      -327 B  (-0.0%)     -533 B  (-0.3%)
async-load-calypso-post-editor-media-modal                                             +261 B  (+0.0%)     +798 B  (+0.2%)
async-load-calypso-blocks-editor-checkout-modal                                        -247 B  (-0.0%)     -240 B  (-0.1%)
async-load-automattic-help-center-stepper                                              -234 B  (-0.0%)     -108 B  (-0.0%)
async-load-design-wordpress-components-gallery                                         -208 B  (-0.0%)     -262 B  (-0.1%)
async-load-automattic-whats-new                                                        -208 B  (-0.6%)      -19 B  (-0.2%)
async-load-my-sites-checkout-purchase-modal-is-eligible-for-one-click-checkou...       -191 B  (-0.0%)      -24 B  (-0.0%)
async-load-signup-steps-page-picker                                                    -178 B  (-0.0%)      -23 B  (-0.0%)
async-load-signup-steps-emails                                                         -178 B  (-0.2%)      -25 B  (-0.1%)
async-load-purchase-modal-wrapper                                                      -178 B  (-0.0%)      -24 B  (-0.0%)
async-load-design                                                                      +157 B  (+0.0%)     +733 B  (+0.2%)
async-load-signup-steps-design-picker                                                  -133 B  (-0.1%)      -29 B  (-0.1%)
async-load-design-playground                                                           +116 B  (+0.0%)     +485 B  (+0.1%)
async-load-calypso-blocks-jitm-templates-modal                                         -105 B  (-0.2%)       -1 B  (-0.0%)
async-load-signup-steps-woocommerce-install-step-store-address                         -103 B  (-0.1%)      -27 B  (-0.1%)
async-load-calypso-jetpack-cloud-sections-sidebar-navigation-manage-selected-...       +103 B  (+0.1%)      +63 B  (+0.2%)
async-load-calypso-lib-store-sandbox-helper                                             +78 B  (+0.2%)       +4 B  (+0.0%)
async-load-signup-steps-woocommerce-install-step-business-info                          +67 B  (+0.1%)     +464 B  (+1.1%)
async-load-signup-steps-plans-theme-preselected                                         +67 B  (+0.0%)     +472 B  (+0.3%)
async-load-signup-steps-plans                                                           +67 B  (+0.0%)     +472 B  (+0.3%)
async-load-quick-language-switcher                                                      +67 B  (+0.1%)     +468 B  (+1.2%)
async-load-calypso-lib-account-settings-helper                                          +67 B  (+0.0%)     +468 B  (+0.8%)
async-load-calypso-layout-command-palette                                               -66 B  (-0.0%)      +77 B  (+0.1%)
async-load-calypso-post-editor-editor-media-modal                                       +65 B  (+0.0%)     +401 B  (+0.1%)
async-load-comment-block-editor                                                         -15 B  (-0.0%)     +285 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@alshakero alshakero changed the title Implement multi email forwards Domains: Implement multi-target email forwards Jan 27, 2025
@alshakero alshakero added the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Jan 27, 2025
@a8ci18n
Copy link

a8ci18n commented Jan 28, 2025

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/17215663

Some locales (Hebrew, Japanese, Spanish) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday.

Hi @alshakero, could you please edit the description of this PR and add a screenshot for our translators? Ideally it'd include all of the following strings:

  • This mailbox is already forwarded to the maximum number of destinations.
  • Forward to
  • These are the target email addresses where your emails will be forwarded.
  • Forward from
  • Confirm forwards
  • Are you sure you want to remove this email forward?
  • This will remove it from our records and if it's not used in another forward, it will require reverficiaton if added again.
  • There is already a forward from (%1$s) to (%2$s).
  • You cannot forward to the same domain.

Thank you in advance!

@alshakero
Copy link
Member Author

@crisbusquets Hi there! I built what I thought made sense while design is being done. Would be great if you can review what I came up with 🙏🏼

You can use the Live link, then go to /domains/manage/all/email/alshaker.me/alshaker.me (I added you to the site) and look at it. Sadly you won't be able to make changes unless you do some sandboxing and such.

@alshakero alshakero marked this pull request as ready for review January 28, 2025 01:17
@alshakero alshakero requested a review from a team as a code owner January 28, 2025 01:17
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 28, 2025
@agrullon95 agrullon95 self-requested a review January 28, 2025 10:22

/**
* @param newEmailForward a string representing a new email forward
* @returns { boolean } If the email forward is has more than the maximum number of destinations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need to rephrase this

@agrullon95
Copy link
Contributor

agrullon95 commented Jan 28, 2025

@alshakero - I was testing the validation on multiple fields simultaneously and noticed this behavior where the Add button isn't enable. I don't think the average person will do this, but I just wanted to point it out.

Also, erasing an email removes all the valid and invalid emails below it.

CleanShot.2025-01-28.at.18.50.34.mp4

@agrullon95
Copy link
Contributor

agrullon95 commented Jan 28, 2025

Is the Add button supposed to be disabled when I enter an email with the same domain as the source?

CleanShot 2025-01-28 at 19 25 43@2x

Either way, If I click Add, it's not added and this error message is shown:

CleanShot 2025-01-28 at 19 24 36@2x

@escapemanuele
Copy link
Contributor

Is the Add button supposed to be disabled when I enter an email with the same domain as the source?

In the code I see that it is a current limitation that we have, worth it to double check probably. I'm sure @alshakero already did that.

@alshakero
Copy link
Member Author

Hi @crisbusquets @auareyou I implemented the form. Working on the list later tonight. Please take it for a drive at /overview/site-domain/email/alshaker.me/forwarding/add/alshaker.me

@escapemanuele escapemanuele requested a review from a team January 31, 2025 10:00
@escapemanuele
Copy link
Contributor

In this case I added an existing email and a not existing one.

image

Would it be more user friendly to skip the not existing ones but add the existing ones?

</Heading>
<Text>
{ translate(
"This will remove it from our records and if it's not used in another forward, it will require reverficiaton if added again."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"This will remove it from our records and if it's not used in another forward, it will require reverficiaton if added again."
"This will remove it from our records and if it's not used in another forward, it will require reverification if added again."

import { Mailbox } from '../../../../data/emails/types';
import './style.scss';

export function VerificatonPendingNotice( { warnings }: { warnings: Mailbox[ 'warnings' ] } ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Spelling: Lets update VerificatonPendingNotice to VerificationPendingNotice

@escapemanuele
Copy link
Contributor

Incredible work as usual 👏

image

I get this when "The destination address does not appear to exist". Maybe we can improve the error that the user sees.

@matticbot
Copy link
Contributor

matticbot commented Jan 31, 2025

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug implement/mutliple-email-forwards on your sandbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants