{
  "$schema": "http://json-schema.org/draft-06/schema",
  "title": "HTML Email Template Schema",
  "description": "Defines the customization points available in an HTML body email template.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "meta",
    "htmlContent"
  ],
  "properties": {
    "meta": {
      "type": "object",
      "title": "Email",
      "required": [
        "fromName",
        "fromAddress",
        "subject"
      ],
      "additionalProperties": false,
      "properties": {
        "fromName": {
          "type": "string",
          "title": "From Name",
          "default": "My Company",
          "propertyOrder": 1,
          "minLength": 1,
          "options": {
            "validate": [
              "handlebars"
            ]
          }
        },
        "fromAddress": {
          "type": "string",
          "title": "From Address",
          "default": "company@example.com",
          "propertyOrder": 2,
          "minLength": 5,
          "options": {
            "validate": [
              "handlebars"
            ]
          }
        },
        "subject": {
          "type": "string",
          "title": "Subject",
          "propertyOrder": 3,
          "minLength": 1,
          "options": {
            "validate": [
              "handlebars"
            ],
            "input_height": "50px"
          }
        },
        "bcc": {
          "type": "array",
          "title": "BCC",
          "items": {
            "type": "string",
            "minLength": 5
          }
        }
      }
    },
    "htmlContent": {
      "type": "string",
      "title": "HTML Content",
      "description": "Raw HTML content that can use {{mergeTags}} from handlebars"
    },
    "jsonContent": {
      "type": "object",
      "title": "JSON Content",
      "description": "The JSON content for the email editor"
    }
  }
}