SimpleTexting recovery SMS for failed Stripe payments

By General Input

When a Stripe charge or invoice payment fails, send the customer a personalized SimpleTexting recovery SMS and log the attempt on their HubSpot contact.

Integrations

  • SimpleTexting
  • Stripe
  • HubSpot

Type

Agentic Task

Categories

  • Finance
  • Sales

Build me an agent workflow that runs SMS-first dunning on failed Stripe payments, before our email retry cadence takes over.

Trigger: a Stripe webhook on the events invoice.payment_failed and charge.failed. Treat both as the same recovery flow.

When the webhook fires, do the following:

1. Use Stripe Retrieve Charge to pull the amount, currency, last payment method (brand and last 4 if available), failure reason, and attempt count. If the event was invoice.payment_failed, also resolve the underlying charge from the invoice so we have the same fields. Capture the invoice id so we can de-dupe later.

2. Use Stripe Retrieve Customer to get the customer's email, name, and phone number on the Stripe customer object.

3. Use HubSpot Get Contact (lookup by email, idProperty=email) to find the matching contact. Read first name, plan tier (a custom property on the contact), phone number, the SMS opt-out / unsubscribed status, and recent notes that mention prior payment issues.

4. Decide whether to send. Skip silently (no SMS, no note, no error) if any of these are true: the contact has no phone number on file in either HubSpot or Stripe, the contact is opted out of SMS, or a HubSpot note already exists for this invoice id (one SMS per invoice maximum). Prefer the HubSpot phone if both are present.

5. Draft a short, friendly recovery SMS tailored to the situation. Use the customer's first name, the failed amount, and the card brand + last 4 if available. Tone rules:

- First failure (attempt count = 1 and no prior payment-issue notes): warm nudge. Acknowledge cards fail for harmless reasons, ask them to update the card, keep it light.

- Repeat failure (attempt count > 1 or prior payment-issue notes exist): firmer ask with a specific next step ("please update your card by [date] to avoid losing access"). Still polite, never aggressive.

Keep the message under 320 characters, no emojis unless the plan tier is consumer/self-serve, and always sign off with the company name. Do not include a raw URL unless the user provides a billing portal link.

6. Send the SMS using SimpleTexting Send Message to the chosen phone number. Use mode=AUTO.

7. Log the outcome on the HubSpot contact using HubSpot Create Note, associated to the contact. The note body should include: the Stripe invoice id, the failed amount and currency, the failure reason, the attempt count, the exact SMS text that was sent, the timestamp, and a suggested follow-up date (48 hours later if first failure, 24 hours if repeat). This note is also what future runs check to enforce the one-SMS-per-invoice rule.

Error handling: if SimpleTexting Send Message fails (e.g. 422 invalid number, 403 opted out), do not create the note. If HubSpot Create Note fails after the SMS was sent, retry the note creation so the audit trail is preserved. Log skipped runs (no phone, opted out, duplicate invoice) without raising an error.

Out of scope: do not send any emails, do not pause subscriptions, do not modify the customer in Stripe. This workflow is only SMS plus a HubSpot note.

Related prompts

Explore more prompts
Let support send one-off Loops emails without an engineerTurn Mailjet email clicks into ranked HubSpot follow-upsCustomer lifecycle inspector for Loops, Stripe and PostHogiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRM