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

feat: compare previous email on customer updated #1432

Conversation

jbranchaud
Copy link
Contributor

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.

compare

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.
Copy link

linear bot commented Mar 8, 2024

Copy link

vercel bot commented Mar 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
badass-turbo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
colt-steele ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
devrel-fyi ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
epic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
pro-aws ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
pro-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
skill-stack-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
testing-javascript ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm
total-typescript-turbo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 8, 2024 7:13pm

Comment on lines +298 to +304
const {previous_attributes} = z
.object({
previous_attributes: z
.object({email: z.string().optional()})
.optional(),
})
.parse(event.data)
Copy link
Contributor Author

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.

Copy link
Contributor

@joelhooks joelhooks left a 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?

@kodiakhq kodiakhq bot merged commit 1d3e9c2 into main Mar 8, 2024
13 checks passed
@kodiakhq kodiakhq bot deleted the jbranchaud/sks-81-transfer-purchase-doesnt-trigger-email-to-new-user branch March 8, 2024 19:31
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.

None yet

2 participants