{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/crevio-co/json-schema/crevio-co-email-preview-schema.json",
  "title": "EmailPreview",
  "description": "An email rendered for one customer exactly as they would receive it, without sending it.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/crevio-co-broadcasts-api-openapi.yml#/components/schemas/EmailPreview",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "email_preview"
      ]
    },
    "subject": {
      "type": "string",
      "description": "The subject with its variables filled in."
    },
    "preview_text": {
      "type": "string",
      "description": "The inbox preview line with its variables filled in, or empty."
    },
    "html": {
      "type": "string",
      "description": "The whole email, layout included. Its unsubscribe link is a placeholder that unsubscribes nobody."
    },
    "data_source": {
      "type": "string",
      "enum": [
        "none",
        "customer",
        "enrollment",
        "latest_order",
        "no_order"
      ],
      "description": "Whose data filled the variables: `none` (no `customer_id`, so every variable uses its default), `customer` (their details as they are now), `enrollment` (a sequence step for someone enrolled: what they joined with), `latest_order` (not enrolled, so product and order variables come from their latest order) or `no_order` (not enrolled and no order, so those variables are blank)."
    }
  },
  "required": [
    "object",
    "subject",
    "preview_text",
    "html",
    "data_source"
  ]
}