HomeAboutContactLinkedIn

Get notifications when a user upgrades their plan

By Agathe Brusset
Published in Innovation
May 09, 2022
3 min read
Get notifications when a user upgrades their plan

Stripe is a wonderful tool to manage complex products as it’s been created for that specific purpose: to allow mass-scale projects to collect payments. Stripe has been created with developers in mind and made it easy to integrate their solution to any other app. So you’re probably using Stripe as your payment gateway.

I set up a couple of Zaps to be notified when our users upgrade, downgrade or purchase a subscription for the first time. This was possible with Zapier, the Stripe and Slack integrations as well as Zapier actions. It could have been possible to do it just using Stripe’s webhooks as well, but I prefer using Zapier to filter out the actions we don’t want to be notified about, like free plan purchases.

Send a Slack notification when a user has purchased a new plan

Here’s the step-by-step to post a Slack channel message when a new customer has purchased a premium plan:

1. Stripe trigger

Create a Zap with the Stripe integration and “New Event in Stripe” trigger. The event type should be “New Customer Subscription Singup”. Fetch dummy data to test your Zap.

2. Filter action

Add a “Filter by Zapier” action and filter out the following:

a. data.object.items.data.plan.id does not exactly match your free plan price id

b. data.object.cancel_at_period_end is equal to false

c. data.object.status is equal to active

You have this neat tool to view all JSON data

3. Slack action

Add a “Send Channel Message in Slack” action to a specific #sales channel.

Hello! We have a new customer {customer.name} from {customer.address.country}. They purchased a {data.object.items data.plan.nickname} plan.

Add links to your admin dashboard using <linktoyourdashboard.com| text you want to show>

slack new customer

Send a Slack notification when a user upgrades their plan

Here’s the step-by-step to post a Slack channel message when a customer has upgraded to a premium plan:

1. Stripe trigger

Create a Zap with the Stripe integration and “New Event in Stripe” trigger. The event type should be “Subscription Updated”. Fetch dummy data to test your Zap.

2. Filter action

Add a “Filter by Zapier” action and filter out the following:

a. type exactly matches customer.subscription.updated

b. data.object.items.data.plan.id does not contain your free plan price id

c. data.previous_attributes.items.data.plan exists.

Your Zapier Filter Action should look something like this
Your Zapier Filter Action should look something like this

3. Date / Time Formatter action

To answer our most pressing question, I added a date/time formatter to this Zap, to better know the time it took for that user to upgrade. As you have all the necessary information on the Stripe payload, it looks something like this:

a. Transform field set to Compare Dates to have the duration between the two dates.

b. Values field’s start date set to data.previous_attributes.billing_cycle_anchor

c. Values field’s end date set to data.object.current_period_start

d. Both date formats are written in UNIX timestamps, so the format in Zapier is X.

Your Zapier Date Formatter Action should look something like this
Your Zapier Date Formatter Action should look something like this

4. Slack action

Add a “Send Channel Message in Slack” action to your previously created #sales channel.

Hello! We have a customer who upgraded {customer.name} from {customer.address.country}. They upgraded to a {data.object.items data.plan.nickname} plan after being on the {data.previous_attributes.items.data.nickname} plan for {output_days} days.

Add links to your admin dashboard using <linktoyourdashboard.com| text you want to show>

zapier upgrades slack

Send a Slack notification when a user cancels their plan

Here’s the step-by-step to post a Slack channel message when a user downgrades their subscription:

1. Stripe trigger

Create a Zap with the Stripe integration and “New Event in Stripe” trigger. The event type should be “Subscription Updated”. Fetch dummy data to test your Zap.

2. Filter action

Add a “Filter by Zapier” action and filter out the following:

a. data.object.cancel_at_period_end is true

b. data.object.items.data.plan.id does not contain your free plan price id

3. Date / Time Formatter action

To know the time our user spent on our app before downgrading, I added a data formatter action. As you have all the necessary information on the Stripe payload, it looks something like this:

a. Transform field set to Compare Dates to have the duration between the two dates.

b. Values field’s start date set to data.object.created

c. Values field’s end date set to data.object.canceled_at

d. Both date formats are written in UNIX timestamps, so the format in Zapier is X.

4. Slack action

Add a “Send Channel Message in Slack” action to a specific #sales channel.

Oh no :cry:, {customer.name} has decided to cancel their {data.object.items data.plan.nickname} plan at the end of the month, after using {productname} for {output_days} days.

Add links to your admin dashboard using <linktoyourdashboard.com| text you want to show>

slack user downgraded

5. Bonus: win the customer back!

Are you bummed they downgraded and want to win this customer back or at least hear their story? Send them an email!

a. Set up a Zapier Delay action with the value you want so the email is not sent straight after the cancellation.

b. Create a Send an email action with the software of your choice. I’m using MailerSend to send a template-based email to that user.

  • The from email address has to be one from the domain you verified or from a sender identity you created.
  • The Sender Name can be from your Sales team or your Customer Support manager.
  • The To email address is the {customer.email} from Stripe.
  • The template ID is the template you created on MailerSend.
  • The variables part is the list of all {variables} included in your template, like {name} is set to {customer.name} from Stripe.

mailersend zapier

There you go, with those three Zaps, you’re setting up a very useful #sales Slack channel so your whole team can celebrate and reflect on users’ purchasing behavior!


Continue your research:

Learn more about Stripe’s growth strategy

Display all your JSON’s secrets with this handy tool: Jsonvisio.com


Tags

#revenue#zapier#stripe
Previous Article
Effectively manage the maintance of your SDKs
Agathe Brusset

Agathe Brusset

Product Manager

Topics

Case Studies
Fundamentals
Innovation

Related Posts

Github Projects - Make Github work for you as a product manager
March 16, 2022
4 min
© 2022, All Rights Reserved.

Quick Links

AboutContact

Social Media