feat(passkeys): Add postAddPasskey email template#20305
Conversation
c699351 to
5ec1d3f
Compare
bcolsson
left a comment
There was a problem hiding this comment.
No issues with the strings here, but wondering if this needs to be added to the gruntfile.js to make sure these are extracted for localization?
88268e9 to
97d99a6
Compare
vbudhram
left a comment
There was a problem hiding this comment.
Code and storybook look good, ![]()
| 'https://privacyportal.onetrust.com/webform/1350748f-7139-405c-8188-22740b3b5587/4ba08202-2ede-4934-a89e-f0b0870f95f0', | ||
| 'https://support.mozilla.org/kb/secure-mozilla-account-two-step-authentication', | ||
| }, | ||
| // TODO: Replace with dedicated passkeys support article URL when available |
There was a problem hiding this comment.
Just curious, do we have a ticket for this?
There was a problem hiding this comment.
There's a draft in progress with https://mozilla-hub.atlassian.net/browse/FXA-12709 but the official request isn't filed yet.
There was a problem hiding this comment.
Pull request overview
Adds a new “postAddPasskey” security notification email and wires it into the passkey registration success flow, including new support/security links used by the template.
Changes:
- Added
postAddPasskeyemail template (HTML + plaintext), plus a newautomatedEmailSignInfooter partial. - Triggered sending the new email on successful passkey registration (
/passkey/registration/finish), with tests. - Extended link/config plumbing for passkey/support/security URLs and removed duplicate support links from several plaintext templates.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-auth-server/lib/senders/fxa-mailer.ts | Adds sendPostAddPasskeyEmail and link construction for the new template. |
| packages/fxa-auth-server/lib/senders/fxa-mailer-sanity-check.ts | Adds a typed sanity-check invocation for the new mailer method. |
| packages/fxa-auth-server/lib/routes/passkeys.ts | Sends the post-add-passkey email after successful passkey registration (errors swallowed + logged). |
| packages/fxa-auth-server/lib/routes/passkeys.spec.ts | Adds tests covering email send behavior (success/failure/canSend/error swallow). |
| packages/fxa-auth-server/config/index.ts | Adds new SMTP config keys for passkey/review-activity support URLs and sets derived defaults. |
| packages/fxa-admin-server/src/config/index.ts | Adds matching config keys + corrects twoFactorSupportUrl documentation/default. |
| libs/accounts/email-renderer/src/templates/postSigninRecoveryPhone/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/postSigninRecoveryCode/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/postRemoveRecoveryPhone/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/postChangeRecoveryPhone/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/postAddRecoveryPhone/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/postAddPasskey/index.txt | Adds plaintext template for “passkey created” email. |
| libs/accounts/email-renderer/src/templates/postAddPasskey/index.ts | Registers template metadata + TemplateData type. |
| libs/accounts/email-renderer/src/templates/postAddPasskey/index.stories.ts | Adds Storybook stories (with/without Sync note). |
| libs/accounts/email-renderer/src/templates/postAddPasskey/index.mjml | Adds HTML template for “passkey created” email. |
| libs/accounts/email-renderer/src/templates/postAddPasskey/en.ftl | Adds Fluent strings for the new template. |
| libs/accounts/email-renderer/src/templates/passwordResetRecoveryPhone/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/passwordReset/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/passwordChanged/index.txt | Removes duplicated plaintext support partial include. |
| libs/accounts/email-renderer/src/templates/index.ts | Exports postAddPasskey template module. |
| libs/accounts/email-renderer/src/renderer/fxa-email-renderer.ts | Adds renderPostAddPasskey renderer method. |
| libs/accounts/email-renderer/src/renderer/fxa-email-renderer.spec.ts | Adds snapshot tests for postAddPasskey (with/without Sync note). |
| libs/accounts/email-renderer/src/renderer/email-link-builder.ts | Adds campaign/content mappings and new link helpers (security settings + support URLs). |
| libs/accounts/email-renderer/src/renderer/email-link-builder.spec.ts | Adds unit tests for the new link-builder methods/config. |
| libs/accounts/email-renderer/src/renderer/snapshots/fxa-email-renderer.spec.ts.snap | Adds snapshots for the new rendered email. |
| libs/accounts/email-renderer/src/partials/automatedEmailSignIn/index.txt | Adds new plaintext footer partial for “review security settings / support” guidance. |
| libs/accounts/email-renderer/src/partials/automatedEmailSignIn/index.ts | Adds TemplateData type for the new footer partial. |
| libs/accounts/email-renderer/src/partials/automatedEmailSignIn/index.stories.ts | Adds Storybook story for the new footer partial. |
| libs/accounts/email-renderer/src/partials/automatedEmailSignIn/index.mjml | Adds MJML footer partial content. |
| libs/accounts/email-renderer/src/partials/automatedEmailSignIn/en.ftl | Adds Fluent strings for the new footer partial. |
| libs/accounts/email-renderer/gruntfile.js | Registers new FTL files for build/packaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <%- include('/partials/userInfo/index.txt') %> | ||
|
|
||
| <%- include('/partials/automatedEmailResetPassword/index.txt') %> | ||
| <%- include('/partials/support/index.txt') %> |
There was a problem hiding this comment.
Thanks for catching this. I feel like the real issue is that automatedEmailResetPassword/index.txt repeats the 'For more info, visit Mozilla Support:string that belongs to/partials/support/index.txt. Can we remove the support verbiage from automatedEmailResetPassword/index.txt` instead?
There was a problem hiding this comment.
Hmm, maybe that'd also need to be done in the mjml files... Feel free to treat this as a nit / optional feedback. This is probably the most direct thing to do for time being. Alternatively, this fix should probably be done in a separate PR.
Because: * We want to send a security notification to users when a passkey is added to their account This commit: * Add a new email footer partial with action items if the new passkey is unexpected * Add new email template * Sets up email send when passkey registration is successful Closes #FXA-13367
Because
This pull request
Issue that this pull request solves
Closes: FXA-13367
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
See storybook:
https://mozilla.github.io/fxa/storybooks/pr-20305/email-renderer/?path=/story/fxa-emails-templates-postaddpasskey--post-add-passkey
Other information (Optional)
The "learn more" url is a placeholder, we don't have a support article yet.