#Derek Lance - subscription cancel emails
1 messages ยท Page 1 of 1 (latest)
This is something you'd send from your system, not an email Stripe sends automatically
eg, after you make the API request to cancel
if you use other mechanisms to cancel (payment failure config, customer portal) then you may want to set up subscription cancelation webhooks to trigger your emails
Derek Lance - subscription cancel emails
looks like this what im interested in https://stripe.com/docs/invoicing/send-email
was just wondering if there was some no-code solution for sending an email on cancellation but looks like there isn't
There's no email for cancelled subscriptions though, those emails are about recovering failed payments, receipts for successful payments etc
No, there's no, but I can share feedback that it's something you'd like to see ๐
I see, ok thanks
yeah it would be cool if you could select whatever webhook event you want and then have stripe send an email on our behalf whenever any of those events get triggered or something like that
1 more question if you don't mind
if I cancel a user's subscription at the end of the billing period, which web hook would be triggered immediately when that cancellation happens? would it be subscription_schedule.canceled?
Do you mean setting the subscription to cancel at the end of the period (in the future)?
yes
but i want the webhook to trigger when i set the subscription to cancel in the future, not when it actually cancels if that makes sense
At the time you make that request you'd get customer.subscription.updated
then when the period ends you'd get customer.subscription.deleted
https://stripe.com/docs/api/events/types#event_types-customer.subscription.deleted
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
NP!
i lied 1 more question lol
in our webhook when we handle a customer.subscription.updated event, is there a way to check if the subscription was cancelled? we can use the cancel_at_period_end flag, but that won't tell us if the subscription was cancelled by this event, it just shows us that "this subscription is going to be cancelled at the end of the period". We want to perform an action when the user cancels, but we don't want to perform the action multiple times
hopefully that made sense
It shouldn't be cancelled right then unless you happened to make the request exactly at the period ending time
in those events though you can review the previous_attributes hash to see what has changed
If the status changes, you'd see that reflected
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah perfect!