Skip to content

Use Profile#initiating_service_provider to determine SP named in account_verified email#11218

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-update-alert-user-about-account-verified
Sep 10, 2024
Merged

Use Profile#initiating_service_provider to determine SP named in account_verified email#11218
jmhooper merged 2 commits intomainfrom
jmhooper-update-alert-user-about-account-verified

Conversation

@jmhooper
Copy link
Contributor

@jmhooper jmhooper commented Sep 9, 2024

When a user completes verification we send them an account_verified email which contains the following information:

  • The date the verification occurred
  • The service provider for which the verification was performed

This applies to all verifications except for verifications through in-person which have their own email.

Prior to this commit the service provider was determined using the SP in the session. This means that when the user is verifying in an out-of-band flow (verify-by-mail or fraud review in this case) their email would likely not contain the name of the SP that triggered the verification. For verify-by-mail we tell the user to enter their code by going to “secure.login.gov”. In this case there is no SP in the session. For fraud review we made no effort to send an email with a named SP.

This commit modifies the logic to use Profile#initiating_service_provider to determine which SP to name in the email. As a result the email should contain the name of the service provider for which the user was originally proofing. This will be true for the inline flow and the out-of-band flows.

The UserAlerts::AlertUserAboutAccountVerified service is used to send these account_verified notifications. This commit changes this service to take a profile as its only argument since all of the information necessary for this email is accessible via the Profile model.

…ccount_verified` email

When a user completes verification we send them an `account_verified` email which contains the following information:

- The date the verification occurred
- The service provider for which the verification was performed

This applies to all verifications except for verifications through in-person which have their own email.

Prior to this commit the service provider was determined using the SP in the session. This means that when the user is verifying in an out-of-band flow (verify-by-mail or fraud review in this case) their email would likely not contain the name of the SP that triggered the verification. For verify-by-mail we tell the user to enter their code by going to “secure.login.gov”. In this case there is no SP in the session. For fraud review we made no effort to send an email with a named SP.

This commit modifies the logic to use `Profile#initiating_service_provider` to determine which SP to name in the email. As a result the email should contain the name of the service provider for which the user was originally proofing. This will be true for the inline flow and the out-of-band flows.

The `UserAlerts::AlertUserAboutAccountVerified` service is used to send these `account_verified` notifications. This commit changes this service to take a profile as its only argument since all of the information necessary for this email is accessible via the profile model.

[skip changelog]
@jmhooper jmhooper requested review from matthinz and n1zyy September 9, 2024 19:27
Co-authored-by: Zach Margolis <zachmargolis@users.noreply.github.com>
@jmhooper jmhooper merged commit 34868a8 into main Sep 10, 2024
@jmhooper jmhooper deleted the jmhooper-update-alert-user-about-account-verified branch September 10, 2024 12:52
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.

3 participants