{
  "slug": "password-reset-email",
  "title": "Password reset email: template and code",
  "url": "https://www.courier.com/recipes/password-reset-email",
  "markdown": "https://www.courier.com/recipes/password-reset-email.md",
  "stage": "Account and security",
  "purpose": "Send a password reset email with a link that expires, and never deliver a stale one.",
  "summary": "A password reset email sends a link to choose a new password when someone asks for one. It's a single email with one button, plus a line telling anyone who didn't ask that their password hasn't changed. Courier stops trying to deliver it after 30 minutes, so an expired link never arrives.",
  "channels": [
    "email"
  ],
  "shape": "send",
  "shows": [
    "A reset email with one button and one job",
    "A retry window that matches the link's lifetime",
    "A line for anyone who didn't ask for the reset"
  ],
  "data": [
    {
      "name": "reset_url",
      "type": "URL",
      "example": "https://app.acme.com/reset-password?token=8d2f6a",
      "note": "Your app creates the link and its token"
    }
  ],
  "steps": [
    {
      "step": "1",
      "when": "When someone asks to reset their password",
      "channels": "Email",
      "templates": [
        "templates/password-reset.json"
      ]
    }
  ],
  "files": {
    "templates": [
      "templates/password-reset.json"
    ],
    "setup": [
      "setup.ts"
    ],
    "start": [
      "start.ts",
      "start.py"
    ]
  },
  "docs": [
    "https://www.courier.com/docs/send/overview",
    "https://www.courier.com/docs/send/routing",
    "https://www.courier.com/docs/send/statuses"
  ],
  "related_recipes": [
    "https://www.courier.com/recipes/magic-link-email",
    "https://www.courier.com/recipes/new-device-login-alert",
    "https://www.courier.com/recipes/otp-sms-email-fallback"
  ],
  "agent_prompt": "Add password reset emails to this app, sent through Courier: one email with a Reset your password button, the link's expiry in the copy, and no retries after the link expires. Follow the steps at https://www.courier.com/recipes/password-reset-email.md and use the Courier skill for SDK details.\n\n1. Create the template in my Courier workspace by running setup.ts from that page with COURIER_API_KEY from our environment. Save the template ID it prints as COURIER_PASSWORD_RESET_TEMPLATE_ID.\n2. Find where this codebase creates a password reset token and send the email there with the recipe's send code. Pass only reset_url. Replace the placeholder product name (Acme) in the template with ours, and make its \"30 minutes\" match the token's real lifetime and the send timeout.\n3. Match this codebase's language, file layout, and error handling. Never hardcode the API key.\n4. When you're done, request a reset for a test user and show me the rendered email.",
  "status": {
    "state": "passing",
    "last_tested": "2026-10-19"
  }
}
