Skip to content

fix: use wallet OTP email for email changes - #46

Merged
jmgasper merged 1 commit into
developfrom
change_email
Aug 31, 2026
Merged

fix: use wallet OTP email for email changes#46
jmgasper merged 1 commit into
developfrom
change_email

Conversation

@jmgasper

Copy link
Copy Markdown
Contributor

Summary

  • Replace the activation-email template used by email-change ownership checks with the same SendGrid OTP template used by wallet withdrawals.
  • Send the wallet template contract: member name in name and the six-digit code in otp.
  • Use the member first and last name with handle fallback, plus the same v3 email event shape as tc-finance-api.
  • Add the shared template setting to the sample environment and documentation.

Root cause

The email-change flow used SENDGRID_RESEND_ACTIVATION_EMAIL_TEMPLATE_ID with handle/code fields. That selects the registration activation email and leaves the wallet template name/otp fields empty.

Testing

  • pnpm lint
  • pnpm build
  • pnpm exec jest src/api/user/email-change.service.spec.ts --runInBand (4 tests)

The regression test asserts the complete outbound payload, including the wallet template ID d-2d0ab9f6c9cc4efba50080668a9c35c1, name, otp, sender, recipient, and v3 version.

@jmgasper
jmgasper merged commit 9de5ac4 into develop Aug 31, 2026
5 checks passed
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.

1 participant