{
  "schema_version": "1.0.0",
  "id": "stripe-cancellation-exit-survey",
  "title": "Send an exit survey when a Stripe subscription is canceled",
  "category": "finance",
  "difficulty": "beginner",
  "featured": false,
  "description": "When a subscription is canceled, email the customer a one-question survey, mark them as churned in HubSpot, and tell the team.",
  "tags": [
    "stripe",
    "churn",
    "hubspot",
    "gmail",
    "surveys"
  ],
  "apps": [
    "Stripe",
    "Gmail",
    "HubSpot",
    "Slack"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 3 steps after the trigger"
    ]
  },
  "tasks": {
    "typical": 3,
    "max": 3
  },
  "trigger": {
    "app": "Stripe",
    "event": "Canceled Subscription",
    "kind": "instant",
    "title": "Subscription canceled",
    "why": "Fires when a subscription ends.",
    "config": {
      "Account": "YOUR_STRIPE_ACCOUNT"
    },
    "outputs": [
      "subscription_id",
      "customer_id",
      "customer_email",
      "customer_name",
      "plan_name",
      "canceled_at",
      "cancel_reason"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "survey",
      "kind": "action",
      "app": "Gmail",
      "event": "Send Email",
      "title": "Email a one-question survey",
      "why": "One question with a reply link gets far more answers than a form with ten.",
      "fields": {
        "To": "{{trigger.customer_email}}",
        "Subject": "One question before you go",
        "Body Type": "plain",
        "Body": "Hi {{trigger.customer_name}},\n\nYour {{trigger.plan_name}} subscription has ended. Could you tell us, in a line, the main reason you canceled? Just reply to this email.\n\nIf it was a mistake, you can restart any time and your data is still here.\n\nThanks,\nYOUR_NAME",
        "From Name": "YOUR_NAME"
      },
      "outputs": [
        "id",
        "thread_id"
      ]
    },
    {
      "key": "crm",
      "kind": "action",
      "app": "HubSpot",
      "event": "Create or Update Contact",
      "title": "Mark the contact as churned",
      "why": "Keeps the CRM honest: lifecycle stage and cancel date are updated on the existing contact.",
      "fields": {
        "Email": "{{trigger.customer_email}}",
        "Lifecycle Stage": "other",
        "Customer status": "Churned",
        "Churn date": "{{trigger.canceled_at}}",
        "Last plan": "{{trigger.plan_name}}"
      },
      "outputs": [
        "id",
        "is_new"
      ]
    },
    {
      "key": "tell",
      "kind": "action",
      "app": "Slack",
      "event": "Send Channel Message",
      "title": "Tell the team",
      "why": "A short note in the customer channel; the survey answer arrives by email later.",
      "fields": {
        "Channel": "#customers",
        "Message Text": "Canceled: {{trigger.customer_name}} ({{trigger.plan_name}}). Stripe reason: {{trigger.cancel_reason}}. Exit survey sent.",
        "Send as a bot?": "Yes",
        "Bot Name": "Zap alerts",
        "Include a link to this Zap?": "No"
      },
      "outputs": [
        "ts",
        "permalink"
      ]
    }
  ]
}
