{
  "name": "Stripe Customer → Personalized Welcome Email — Purrly",
  "platform": "zapier",
  "metadata": {
    "platform": "zapier",
    "title": "Stripe Customer → Personalized Welcome Email",
    "trigger_app": "stripe",
    "trigger_event": "customer.created",
    "action_apps": ["stripe", "mailchimp"],
    "required_accounts": [
      {
        "app": "Stripe",
        "purpose": "Source trigger — fires on new customer.created events.",
        "fields": ["STRIPE_API_KEY (read-only, account-level)"]
      },
      {
        "app": "Mailchimp",
        "purpose": "Destination — sends the personalized welcome campaign.",
        "fields": [
          "MAILCHIMP_API_KEY",
          "MAILCHIMP_AUDIENCE_ID",
          "SENDER_NAME",
          "WELCOME_EMAIL_SUBJECT"
        ]
      }
    ],
    "placeholders": [
      "[STRIPE_API_KEY]",
      "[MAILCHIMP_API_KEY]",
      "[MAILCHIMP_AUDIENCE_ID]",
      "[SENDER_NAME]",
      "[WELCOME_EMAIL_SUBJECT]"
    ]
  },
  "flow": {
    "modules": [
      {
        "id": 1,
        "key": "stripe.new_customer_trigger",
        "app": "stripe",
        "role": "trigger",
        "event": "customer.created",
        "description": "Fires every time Stripe logs a new customer — captured within seconds of the originating charge on a paid Zapier plan, every 1–2 minutes on the free tier.",
        "output_fields": [
          "customer.id",
          "customer.email",
          "customer.name",
          "customer.created",
          "customer.description",
          "customer.metadata"
        ]
      },
      {
        "id": 2,
        "key": "stripe.get_customer_action",
        "app": "stripe",
        "role": "action",
        "operation": "retrieve_customer",
        "description": "Pulls the full Stripe customer record by ID — guarantees the welcome email has the authoritative name, email, signup date, and any custom metadata you’ve stored on the customer (plan tier, referrer, MRR).",
        "input_fields": ["customer_id (from module 1)"],
        "output_fields": [
          "customer.email",
          "customer.name",
          "customer.phone",
          "customer.created",
          "customer.metadata.plan",
          "customer.metadata.tier",
          "customer.description"
        ]
      },
      {
        "id": 3,
        "key": "mailchimp.send_email_action",
        "app": "mailchimp",
        "role": "action",
        "operation": "send_campaign",
        "description": "Sends the personalized welcome campaign to the new customer’s email. Merge tags (*|FNAME|*, *|SIGNUPDATE|*) are populated from the Stripe lookup fields, so the same campaign template renders a unique email per recipient.",
        "input_fields": [
          "audience_id (MAILCHIMP_AUDIENCE_ID)",
          "to_email (from module 2)",
          "from_name (SENDER_NAME)",
          "subject (WELCOME_EMAIL_SUBJECT)",
          "merge_fields.fname (from module 2.customer.name)",
          "merge_fields.signupdate (from module 2.customer.created)"
        ],
        "output_fields": ["send.id", "send.status", "send.timestamp"]
      }
    ]
  },
  "setup": {
    "estimated_minutes": 20,
    "steps": [
      {
        "order": 1,
        "title": "Create the Zap and connect Stripe",
        "detail": "In Zapier click Create Zap, pick Stripe as the trigger app, choose New Customer as the trigger event, and connect your Stripe account using a read-only API key with the customers resource scope."
      },
      {
        "order": 2,
        "title": "Add the Get Customer action",
        "detail": "Add a Stripe action step, choose the Retrieve Customer operation, and map the customer.id from the trigger into the input field. This guarantees the welcome email has the full Stripe record — name, email, created timestamp, and any custom metadata."
      },
      {
        "order": 3,
        "title": "Connect Mailchimp and send the campaign",
        "detail": "Add a Mailchimp action step, choose Send Campaign, connect your Mailchimp account, and select the MAILCHIMP_AUDIENCE_ID. Map customer.email into the recipient, SENDER_NAME into the from name, and WELCOME_EMAIL_SUBJECT into the subject. Use merge tags *|FNAME|* and *|SIGNUPDATE|* in the campaign template — they’ll fill in from the Stripe data automatically."
      },
      {
        "order": 4,
        "title": "Test and turn the Zap on",
        "detail": "Click Test & Review with a sandbox Stripe customer to confirm the email arrives correctly, then flip the Zap to On. New real Stripe customers trigger the welcome within seconds."
      }
    ]
  }
}
