{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/poptin/json-schema/poptin-send-template-email-request-schema.json",
  "title": "SendTemplateEmailRequest",
  "x-generated": "2026-12-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/poptin-api-openapi.yml#/components/schemas/SendTemplateEmailRequest",
  "type": "object",
  "properties": {
    "template_uid": {
      "type": "string",
      "description": "The UID of the template to send."
    },
    "from_name": {
      "type": "string",
      "description": "The display name shown as the email sender.",
      "maxLength": 255
    },
    "from_email": {
      "type": "string",
      "format": "email",
      "description": "The email address to send from. The domain must be a verified and active sending domain for your account.",
      "maxLength": 255
    },
    "reply_to": {
      "type": [
        "string",
        "null"
      ],
      "format": "email",
      "description": "Optional reply-to email address. Defaults to `from_email` when omitted.\nThe domain must be a verified and active sending domain for your account.",
      "maxLength": 255
    },
    "recipient": {
      "type": "string",
      "description": "The contact UID or email address to send the email to.\nThe contact must be subscribed to your mail-list.",
      "maxLength": 255
    },
    "subject": {
      "type": "string",
      "description": "The subject of the email.",
      "minLength": 1,
      "maxLength": 200
    },
    "pretext": {
      "type": [
        "string",
        "null"
      ],
      "description": "The pretext of the email.",
      "maxLength": 500
    },
    "merge_tags": {
      "type": [
        "object",
        "null"
      ],
      "description": "Optional fallback values for merge tags used in the template, subject, or pretext.\nContact data is used first; payload values apply only when the resolved tag is empty or missing.\nExample: if the contact has `CONTACT_FIRST_NAME=John` and the payload sends `CONTACT_FIRST_NAME=Jack`,\nthe email keeps `John`. If `CONTACT_LAST_NAME` is empty on the contact, a payload value is used instead.",
      "default": null,
      "additionalProperties": {
        "type": [
          "string",
          "number",
          "boolean"
        ]
      }
    },
    "force": {
      "type": "boolean",
      "description": "Force send even if the email has already been sent.",
      "default": false
    }
  },
  "required": [
    "template_uid",
    "from_name",
    "from_email",
    "recipient",
    "subject"
  ]
}