{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendar-app/json-schema/sendar-app-email-detail-schema.json",
  "title": "EmailDetail",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendar-app-openapi.json#/components/schemas/EmailDetail",
  "allOf": [
    {
      "$ref": "#/$defs/EmailLog"
    },
    {
      "type": "object",
      "required": [
        "html",
        "bodyText"
      ],
      "properties": {
        "html": {
          "type": [
            "string",
            "null"
          ]
        },
        "bodyText": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  ],
  "$defs": {
    "EmailLog": {
      "type": "object",
      "required": [
        "id",
        "providerEmailId",
        "fromAddress",
        "toAddresses",
        "subject",
        "status",
        "errorMessage",
        "scheduledAt",
        "trackOpens",
        "trackClicks",
        "openedAt",
        "clickedAt",
        "openCount",
        "clickCount",
        "createdAt",
        "updatedAt"
      ],
      "properties": {
        "id": {
          "type": "integer"
        },
        "providerEmailId": {
          "type": [
            "string",
            "null"
          ]
        },
        "scheduledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "fromAddress": {
          "type": "string"
        },
        "toAddresses": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subject": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "errorMessage": {
          "type": [
            "string",
            "null"
          ]
        },
        "trackOpens": {
          "type": "boolean"
        },
        "trackClicks": {
          "type": "boolean"
        },
        "openedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "First recorded open (null until one happens)."
        },
        "clickedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "First recorded click (null until one happens)."
        },
        "openCount": {
          "type": "integer"
        },
        "clickCount": {
          "type": "integer"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}