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

Email: Surface different warning message when the email subscription and domain are owned by different users #68601

Merged

Conversation

wongasy
Copy link
Contributor

@wongasy wongasy commented Oct 4, 2022

Proposed Changes

In the case where the domain and email subscription are owned by different users, our new messaging that suggests the user to contact the owner of the email / domain will not work. Since the user must be both the domain and email subscription owner in order to make a purchase. Therefore, we will need separate messaging to address this scenario, and this PR introduces a new component for this case.

Testing Instructions

  • Have two different user accounts - User A and User B
  • Have a Professional Email subscription as User A
  • Follow the steps here pbLl1t-LC-p2 to transfer the Professional Email subscription to User B
  • As User A, visit Upgrades > Emails, you should see the new messaging introduced in this PR
  • As User B, visit Upgrades > Emails, you should see the new messaging introduced in this PR

Screen Shot 2022-10-04 at 2 43 24 PM

Pre-merge Checklist

Related to #

@wongasy wongasy requested review from a team October 4, 2022 18:33
@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 Oct 4, 2022
@matticbot
Copy link
Contributor

matticbot commented Oct 4, 2022

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

Sections (~145 bytes added 📈 [gzipped])

name   parsed_size           gzip_size
email       +903 B  (+0.1%)     +145 B  (+0.1%)

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

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.

@wongasy wongasy added the [Status] String Freeze Add the [Status] String Freeze label to your PR to ensure new strings are translated before merging label Oct 4, 2022
@a8ci18n
Copy link

a8ci18n commented Oct 4, 2022

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

Thank you @wongasy for including a screenshot in the description! This is really helpful for our translators.

@stephanethomas stephanethomas changed the title Email: Surface different warning message when the email subscription … Email: Surface different warning message when the email subscription and domain are owned by different users Oct 5, 2022
Copy link
Contributor

@stephanethomas stephanethomas left a comment

Choose a reason for hiding this comment

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

I've left a number of comments but the most important one is probably documenting the differences between canCurrentUserAddEmail and canDomainOwnerAddEmail in a clear way.

client/lib/domains/can-domain-owner-add-email.ts Outdated Show resolved Hide resolved
client/lib/domains/can-domain-owner-add-email.ts Outdated Show resolved Hide resolved
client/lib/domains/index.js Outdated Show resolved Hide resolved
eventName="calypso_email_providers_nonowner_impression"
eventProperties={ { source } }
/>
<p className="email-non-owner-message__non-owner-message">
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a big fan of reusing the class name of another component. Could we find a way to share styles between those two components in a cleaner way?

Copy link
Contributor

@nightnei nightnei Oct 5, 2022

Choose a reason for hiding this comment

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

It seems that it's typo, since we have styles for className email-non-domain-owner-message__non-owner-message

https://github.com/Automattic/wp-calypso/blob/improve/email-management-for-different-owners/client/my-sites/email/email-non-domain-owner-message/style.scss#L7

@nightnei
Copy link
Contributor

nightnei commented Oct 5, 2022

@wongasy WDYT about wrapping these two components (email-non-domain-owner-message & email-non-owner-message) with directory e.g. messages inside wp-calypso/client/my-sites/email/messages/...? To group them and have a more structured hierarchy, instead of a flat one.

const onClickLink = ( eventType: 'login' | 'support' ) => {
const properties = {
action: eventType,
source,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AllTerrainDeveloper Let's also send the property context: 'different-owners', we can set the context for the other non-owner and non-domain-owner components that you built as well.

@AllTerrainDeveloper
Copy link
Contributor

@wongasy WDYT about wrapping these two components (email-non-domain-owner-message & email-non-owner-message) with directory e.g. messages inside wp-calypso/client/my-sites/email/messages/...? To group them and have a more structured hierarchy, instead of a flat one.

It's a good idea to group them, but I prefer no to do it this in this Pull Request, lets first merge/deploy what we have achieved so far and then better place them in the structure of Calypso

@wongasy
Copy link
Contributor Author

wongasy commented Oct 5, 2022

It's a good idea to group them, but I prefer no to do it this in this Pull Request, lets first merge/deploy what we have achieved so far and then better place them in the structure of Calypso

@AllTerrainDeveloper If we already know that they folder structure will be changed, let's start with the restructure in the main PR, instead of circling back to it, so we don't have to do a separate deploy just to move the files around and having to go through regression testing.

@AllTerrainDeveloper AllTerrainDeveloper force-pushed the improve/email-management-for-non-owners branch 2 times, most recently from 54339c3 to 20735b5 Compare October 6, 2022 13:17
@AllTerrainDeveloper AllTerrainDeveloper force-pushed the improve/email-management-for-different-owners branch from c120f97 to 4c0555e Compare October 6, 2022 14:09
@AllTerrainDeveloper
Copy link
Contributor

It's a good idea to group them, but I prefer no to do it this in this Pull Request, lets first merge/deploy what we have achieved so far and then better place them in the structure of Calypso

@AllTerrainDeveloper If we already know that they folder structure will be changed, let's start with the restructure in the main PR, instead of circling back to it, so we don't have to do a separate deploy just to move the files around and having to go through regression testing.

I saw this message too late :( anyway it would be more painful as I would have to apply the renaming painfully 3 times with each rebase...

I can do it here or in another PR, I'm fine with both options.

@wongasy
Copy link
Contributor Author

wongasy commented Oct 6, 2022

it would be more painful as I would have to apply the renaming painfully 3 times with each rebase...
@AllTerrainDeveloper Cool, let's do it in another PR, but we need to be sure to regression test all scenarios.

Copy link
Contributor

@olaseni olaseni left a comment

Choose a reason for hiding this comment

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

This is looking good. I have some comments.

Copy link
Contributor

@fredrikekelund fredrikekelund left a comment

Choose a reason for hiding this comment

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

Looks good and works as expected! 👍 I left one very small (but very important) comment that we should address. Other than that, this is good to go!

different-owners

}

.email-non-domain-owner-message__non-owner-message {
.email-non-domain-owner-message__non-owner-message-message {
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
.email-non-domain-owner-message__non-owner-message-message {
.email-non-domain-owner-message__non-owner-message {

DRY 😉

Base automatically changed from improve/email-management-for-non-owners to trunk October 11, 2022 11:01
 - Move logic to extract the domain user name
 - Explicit function description to ease the location of the event logged in Tracks
 - Change the style class name & padding for the notice.
 - Extract the function that builds the URL login page with email comparison and user login name
…ct component to do not overflow the main render.
wongasy and others added 23 commits October 11, 2022 13:08
Add new styles to the main sheet
Keep showing old notices.
 - Move logic to extract the domain user name
 - Explicit function description to ease the location of the event logged in Tracks
 - Change the style class name & padding for the notice.
 - Extract the function that builds the URL login page with email comparison and user login name
…ct component to do not overflow the main render.
Co-authored-by: Stéphane Thomas <email@stephanethomas.com>
Co-authored-by: Stéphane Thomas <email@stephanethomas.com>
@AllTerrainDeveloper AllTerrainDeveloper force-pushed the improve/email-management-for-different-owners branch from 80bea5d to d516aa9 Compare October 11, 2022 11:18
@AllTerrainDeveloper
Copy link
Contributor

Rebased again due to conflicts...

@AllTerrainDeveloper AllTerrainDeveloper merged commit d5eeff2 into trunk Oct 12, 2022
@AllTerrainDeveloper AllTerrainDeveloper deleted the improve/email-management-for-different-owners branch October 12, 2022 13:01
@github-actions github-actions bot removed [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 labels Oct 12, 2022
@a8ci18n
Copy link

a8ci18n commented Oct 12, 2022

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants