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
feat: compare previous email on customer updated #1432
feat: compare previous email on customer updated #1432
Conversation
Previously we were comparing two emails that were always identical because the user tied to the Merchant Customer record had already been updated. Because of this, an email was never getting sent to the new user.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const {previous_attributes} = z | ||
.object({ | ||
previous_attributes: z | ||
.object({email: z.string().optional()}) | ||
.optional(), | ||
}) | ||
.parse(event.data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can pull the previous email out of previous_attributes
that stripe includes in its webhook payload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, can this be tested?
Previously we were comparing two emails that were always identical
because the user tied to the Merchant Customer record had already been
updated. Because of this, an email was never getting sent to the new
user.