{
  "slug": "win-back-email-sequence",
  "title": "Win-back email sequence: template and code",
  "url": "https://www.courier.com/recipes/win-back-email-sequence",
  "markdown": "https://www.courier.com/recipes/win-back-email-sequence.md",
  "stage": "Retention",
  "purpose": "Bring back users who've gone quiet, and restart the clock whenever they log in.",
  "summary": "A win-back email sequence re-engages users who stop logging in. Fourteen days after their last login it sends an email, then an Inbox note 4 days later, and a final email 3 days after that. Every login restarts the wait, so people who come back never get these messages.",
  "channels": [
    "email",
    "inbox"
  ],
  "shape": "journey",
  "shows": [
    "A wait that restarts on every login",
    "Cancel by user, then invoke again",
    "No audience or daily job to maintain"
  ],
  "data": [
    {
      "name": "profile.first_name",
      "type": "string",
      "example": "Dana",
      "note": "On the user's Courier profile. The emails say \"there\" when it's missing"
    },
    {
      "name": "profile.email",
      "type": "email",
      "example": "dana@example.com",
      "note": "Where the emails go"
    }
  ],
  "steps": [
    {
      "step": "1",
      "when": "14 days after a user's last login",
      "channels": "Email",
      "templates": [
        "templates/winback-first-email.json"
      ]
    },
    {
      "step": "2",
      "when": "4 days after the first email",
      "channels": "Inbox",
      "templates": [
        "templates/winback-inbox.json"
      ]
    },
    {
      "step": "3",
      "when": "3 days after the Inbox note",
      "channels": "Email",
      "templates": [
        "templates/winback-last-email.json"
      ]
    }
  ],
  "files": {
    "journey": "journey.json",
    "templates": [
      "templates/winback-first-email.json",
      "templates/winback-inbox.json",
      "templates/winback-last-email.json"
    ],
    "setup": [
      "setup.ts"
    ],
    "start": [
      "start.ts",
      "start.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"
  ],
  "related_recipes": [
    "https://www.courier.com/recipes/subscription-cancellation-email",
    "https://www.courier.com/recipes/nps-survey-email",
    "https://www.courier.com/recipes/feature-adoption-email-sequence"
  ],
  "agent_prompt": "Add a win-back email sequence to this app, sent through Courier: an email 14 days after a user's last login, an Inbox note 4 days later, and a last email 3 days after that, restarted every time they log in. Follow the steps at https://www.courier.com/recipes/win-back-email-sequence.md and use the Courier skill for SDK details.\n\n1. Create the journey and its three templates in my Courier workspace by running setup.ts from that page with COURIER_API_KEY from our environment. Save the journey ID it prints as COURIER_WINBACK_JOURNEY_ID.\n2. Find where a user logs in and call restartWinBack from start.ts with that journey ID and the user's ID, at most once a day per user (for example on their first login of the day). It cancels the journey with the token reengage-<user_id> and starts it again.\n3. The templates read first_name and email from the user's Courier profile, so make sure those are written at signup.\n4. Match this codebase's language, file layout, and error handling. Never hardcode the API key.\n5. When you're done, call restartWinBack for a test user and show me the run that starts for them.",
  "status": {
    "state": "passing",
    "last_tested": "2026-10-19"
  }
}
