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

Show "Verify you email" if needed before creating a site #24281

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

crazytonyli
Copy link
Contributor

@crazytonyli crazytonyli commented Mar 21, 2025

Alternative solution of #24211. The same "verify your email" content on the me screen is presented as a modal when users with an unverified account tap the "Create a WordPress.com site" button.

Screenshot 2025-03-21 at 2 17 32 PM

Regression Notes

  1. Potential unintended areas of impact

  2. What I did to test those areas of impact (or what existing automated tests I relied on)

  3. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@crazytonyli crazytonyli added this to the 25.9 milestone Mar 21, 2025
@crazytonyli crazytonyli requested review from pmusolino and kean March 21, 2025 01:14
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 25.9. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr24281-4254e7e
Version25.8
Bundle IDcom.jetpack.alpha
Commit4254e7e
App Center Buildjetpack-installable-builds #10805
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr24281-4254e7e
Version25.8
Bundle IDorg.wordpress.alpha
Commit4254e7e
App Center BuildWPiOS - One-Offs #11779
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@pmusolino pmusolino self-assigned this Mar 21, 2025
@pmusolino
Copy link
Member

While testing this PR, I have the impression that the password is not properly set during the registration process, but I do not think it's strictly related to this PR and probably not related to the mobile app (but not 100% sure).

I followed these steps:

  1. Open the app and create a new account via the web login, also setting a password.
  2. I tap the button "Create WordPress.com site."
  3. Then I'll verify the email.
  4. On the web, trying to log in using the username and password redirects me to a magic link login.

Comment on lines +18 to +22
if let account = try? WPAccount.lookupDefaultWordPressComAccount(in: ContextManager.shared.mainContext),
account.needsEmailVerification {
VerifyEmailModal.present(on: viewController)
return
}
Copy link
Member

Choose a reason for hiding this comment

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

I think there is an issue here. The needsEmailVerification will be checked just locally from Core Data. So, if I verify the email and keep the app open, but also if I dismiss the verify email modal and reopen it, we do not check again if the email has been verified, so I'm stuck there. Therefore, I would suggest verifying every time the user taps to create a new site if the email needs verification. Additionally, add a button in VerifyEmailView that allows the user to confirm they verified their email. This way, we can check remotely again if the email has been verified, and this view can be dismissed.

Copy link
Contributor

@kean kean 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, but I think we need to iterate a bit more on it. I'd suggest:

  1. Use EmptyStateView, which is designed for full-screen presentation.
EmptyStateView {
                Label("Verify Your Email", systemImage: "envelope.badge")
            } description: {
                Text("We've sent an email to ") +
                Text(verbatim: "[email protected]") // TODO: use L10n with an argument and AttributedString
                    .fontWeight(.medium) +
                Text(" to verify your email address.")
            } actions: {
                VStack(alignment: .center, spacing: 8) {
                    Text("Haven't received an email? You might need to check you spam or tap the button below to resend it.")
                        .font(.footnote)
                        .foregroundStyle(.secondary)
                        .multilineTextAlignment(.center)
                    Button("Resend Email") {
                        // TODO:
                    }
                }
                .padding(.top, 16)
            }
Screenshot 2025-03-21 at 12 53 05 PM
  1. Slightly change the default l10n.

Out of the scope of this PR

In addition, since this flow is part of the first-time user experience, it needs to be flawless. If email verification is required, it needs to be integrated in the site creation flow as its first (optional) step. You shouldn't need to click "Create Site" again after verifying your email.

Secondary, how does it make any sense that you need to confirm your email address before creating a site? I don't think it does. You created an account with a password, so you should be good. So, before making any changes, I would suggest to try addressing the root cause issue – email verification is required to create your first site.

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

Successfully merging this pull request may close these issues.

5 participants