Sort Stripe buyers into MailerLite groups by spend tier
When a Stripe payment succeeds, file the buyer in the right MailerLite group based on amount and lifetime spend, then ping big wins to Slack.
Build an agent workflow that fires when Stripe sends a webhook for a successful payment (either charge.succeeded or payment_intent.succeeded). The trigger is a Stripe webhook. Verify the Stripe signing secret on every incoming event before doing any work.
When the event arrives, read the customer ID, amount, and product/description out of the payload. Then call Stripe's Retrieve Customer to get the buyer's email and name. Call Stripe's List Invoices filtered to that customer and sum the paid invoice amounts to compute lifetime spend. Capture the most recent paid invoice date as the last purchase date. Treat the current payment as part of lifetime spend even if its invoice has not landed in the list yet.
Decide which MailerLite group the buyer belongs in based on the current payment amount AND lifetime spend together (not a single field). Use these starter rules and expose them as configurable: VIP if the current payment is at least $500 OR lifetime spend has crossed $2,000. Standard Customer if the current payment is at least $50. Low Ticket otherwise. Group names and dollar thresholds must be easy to edit.
Then write to MailerLite. Call MailerLite's Create or Update Subscriber keyed by the buyer's email, setting custom fields last_product, last_amount, total_ltv, and last_purchase_date. Make the custom field names configurable in case the user has named them differently. After upserting the subscriber, call MailerLite's Assign Subscriber to Group with the chosen tier's group ID so the right post-purchase automation fires.
Finally, if the current payment is high value (default: $500 or more) OR the buyer just crossed a lifetime spend threshold for the first time (default: crossed $2,000), call Slack's Send a Message via the Slack Bot integration into the configured revenue channel. The message should include the buyer name and email, the product/description, the payment amount, the new total LTV, and whether they just hit a new tier (for example 'New VIP'). Use a clean one-line format suitable for a revenue channel. Use Slack Bot, not the user Slack integration, since this is a workspace alert.
Configurable knobs the user should be able to tune without editing code: the Stripe webhook events to listen for, the dollar thresholds for each tier, the MailerLite group IDs for each tier, the MailerLite custom field names, the Slack channel ID, and the minimum amount below which the Slack alert is suppressed. Be defensive: skip silently if the event is a test event or has no associated customer email, and avoid posting to Slack twice for the same event if it gets retried by Stripe.
Additional information
What does this prompt do?
- Runs the moment Stripe confirms a successful payment, so the right welcome series starts without delay.
- Looks up the buyer's product, amount, and lifetime spend before deciding which MailerLite group fits.
- Files them into the right tier (for example VIP, standard customer, or low ticket) and updates their MailerLite profile with the latest product, amount, lifetime value, and purchase date.
- Pings your revenue Slack channel with the buyer, product, amount, and total spend whenever it is a big sale or a freshly crossed lifetime threshold.
What do I need to use this?
- A Stripe account with permission to send a webhook on successful payments.
- A MailerLite account with the subscriber groups you want to route buyers into already created (for example VIP, Customer, Low Ticket).
- A Slack workspace and the channel where revenue alerts should land.
How can I customize it?
- Change the dollar thresholds that decide which tier a buyer falls into, or map specific products straight to specific groups.
- Rename or add MailerLite groups so the routing matches your existing post-purchase automations.
- Pick which Slack channel the celebration messages land in, and set a minimum amount so small purchases stay quiet.
Frequently asked questions
Does this work for both one-off charges and subscription invoices?
Will the same buyer get duplicated in MailerLite?
What happens if the buyer was already in another MailerLite group?
Can it stay quiet for small purchases?
Do I have to write any code?
Stop hand-tagging paying customers in MailerLite.
Connect Stripe, MailerLite, and Slack once, and every paying customer lands in the right group with a heads-up for the big wins.