{
  "slug": "nps-survey-email",
  "title": "NPS survey email: template and code",
  "url": "https://www.courier.com/recipes/nps-survey-email",
  "markdown": "https://www.courier.com/recipes/nps-survey-email.md",
  "stage": "Engagement",
  "purpose": "Ask engaged users for an NPS score with one click, and survey nobody more than once every 90 days.",
  "summary": "An NPS survey email asks customers how likely they are to recommend you, with one-click score buttons from 0 to 10. It sends 30 days after signup, and if the email isn't opened, an Inbox reminder follows three days later. Nobody gets surveyed more than once every 90 days, and answering cancels the reminder.",
  "channels": [
    "email",
    "inbox"
  ],
  "shape": "journey",
  "shows": [
    "One-click score buttons that pass the answer in the link",
    "At most one survey per person every 90 days",
    "An Inbox reminder when the email wasn't opened"
  ],
  "data": [
    {
      "name": "user_id",
      "type": "string",
      "example": "user_123",
      "note": "The throttle's key, so each user is counted separately"
    },
    {
      "name": "profile.first_name",
      "type": "string",
      "example": "Dana",
      "note": "From the profile. Write it when the user signs up. The emails say \"there\" when it's missing"
    }
  ],
  "steps": [
    {
      "step": "1",
      "when": "30 days after signup",
      "channels": "Email",
      "templates": [
        "templates/nps-email.json"
      ]
    },
    {
      "step": "2",
      "when": "3 days later",
      "channels": "Inbox",
      "templates": [
        "templates/nps-reminder-inbox.json"
      ]
    }
  ],
  "files": {
    "journey": "journey.json",
    "templates": [
      "templates/nps-email.json",
      "templates/nps-reminder-inbox.json"
    ],
    "setup": [
      "setup.ts"
    ],
    "start": [
      "start.ts",
      "start.py"
    ],
    "stop": [
      "stop.ts",
      "stop.py"
    ]
  },
  "docs": [
    "https://www.courier.com/docs/journeys/nodes/delay",
    "https://www.courier.com/docs/journeys/nodes/send",
    "https://www.courier.com/docs/journeys/nodes/cancel",
    "https://www.courier.com/docs/journeys/invoke",
    "https://www.courier.com/docs/guides/send-your-first-in-app-message"
  ],
  "related_recipes": [
    "https://www.courier.com/recipes/win-back-email-sequence",
    "https://www.courier.com/recipes/feature-adoption-email-sequence",
    "https://www.courier.com/recipes/subscription-cancellation-email"
  ],
  "agent_prompt": "Add an NPS survey to this app, sent through Courier: an email with one-click 0 to 10 score buttons 30 days after signup, and an Inbox reminder 3 days later if the email wasn't opened, with nobody surveyed more than once every 90 days. Follow the steps at https://www.courier.com/recipes/nps-survey-email.md and use the Courier skill for SDK details.\n\n1. Create the journey and its templates in my Courier workspace by replacing Acme and the survey link in the template files with our own, then running setup.ts from that page with COURIER_API_KEY from our environment. Save the journey ID it prints as COURIER_NPS_JOURNEY_ID.\n2. Find where this codebase creates a new user and start the journey there. Pass the fields in the Data fields table (the throttle uses user_id), and make sure first_name is written to their Courier profile at signup. The survey page should read the score from the ?score= query parameter.\n3. Find where a survey answer is saved and cancel the journey with the token nps-<user_id>.\n4. Match this codebase's language, file layout, and error handling. Never hardcode the API key.\n5. When you're done, start one run for a test user and show me the run's steps.",
  "status": {
    "state": "passing",
    "last_tested": "2026-10-19"
  }
}
