{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "title": "Simple Email Template Schema",
  "description": "Defines the customization points available in a Simple Email Template.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "meta",
    "content"
  ],
  "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"
          }
        }
      }
    },
    "content": {
      "type": "object",
      "title": "Content",
      "required": [
        "bodyContent"
      ],
      "additionalProperties": false,
      "properties": {
        "headerImage": {
          "title": "Header Image",
          "type": "string"
        },
        "headerContent": {
          "title": "Header",
          "type": "string",
          "options": {
            "validate": [
              "handlebars"
            ],
            "input_height": "50px"
          }
        },
        "bodyContent": {
          "title": "Body",
          "type": "string",
          "description": "Supports markdown and handlebars expressions. e.g. *bold* _underline_ and [link](https://example.com)",
          "options": {
            "validate": [
              "handlebars"
            ]
          }
        },
        "cta": {
          "type": "object",
          "title": "Call to Action",
          "properties": {
            "enabled": {
              "title": "Display CTA button?",
              "type": "boolean",
              "default": false
            },
            "text": {
              "title": "Text",
              "type": "string"
            },
            "link": {
              "title": "Link",
              "type": "string"
            }
          }
        },
        "footerContent": {
          "title": "Footer",
          "type": "string",
          "options": {
            "validate": [
              "handlebars"
            ],
            "input_height": "50px"
          }
        }
      }
    }
  }
}