{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/modoboa/json-schema/modoboa-send-email-schema.json",
  "title": "SendEmail",
  "description": "Mixin to inject scheduled_datetime logic into a serializer.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/modoboa-webmail-api-openapi.yml#/components/schemas/SendEmail",
  "type": "object",
  "properties": {
    "sender": {
      "type": "string",
      "format": "email"
    },
    "subject": {
      "type": "string"
    },
    "body": {
      "type": "string"
    },
    "to": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "cc": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "bcc": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "email"
      }
    },
    "in_reply_to": {
      "type": "string"
    },
    "references": {
      "type": "string"
    },
    "body_format": {
      "$ref": "#/$defs/BodyFormatEnum"
    },
    "scheduled_datetime": {
      "type": "string",
      "format": "date-time"
    },
    "request_dsn": {
      "type": "boolean",
      "default": false
    },
    "request_mdn": {
      "type": "boolean",
      "default": false
    },
    "mailid": {
      "type": "integer"
    },
    "original_mailbox": {
      "type": "string"
    },
    "original_mailid": {
      "type": "integer",
      "minimum": 1
    },
    "original_action": {
      "$ref": "#/$defs/OriginalActionEnum"
    }
  },
  "required": [
    "sender",
    "to"
  ],
  "$defs": {
    "BodyFormatEnum": {
      "enum": [
        "plain",
        "html"
      ],
      "type": "string",
      "description": "* `plain` - text\n* `html` - html"
    },
    "OriginalActionEnum": {
      "enum": [
        "reply",
        "forward"
      ],
      "type": "string",
      "description": "* `reply` - reply\n* `forward` - forward"
    }
  }
}