{
  "$id": "predefined",
  "type": "object",
  "required": ["account", "email"],
  "properties": {
    "account": {
      "type": "string"
    },
    "email": {
      "oneOf": [
        { "$ref": "common-mailer#/definitions/email" },
        { "type": "string" }
      ]
    },
    "ctx": {
      "type": "object",
      "required": ["nodemailer"],
      "properties": {
        "template": {
          "type": "object",
          "default": {}
        },
        "nodemailer": {
          "$ref": "common-mailer#/definitions/email"
        }
      }
    }
  },
  "if": {
    "properties": {
      "email": { "type": "string" }
    }
  },
  "then": {
    "required": ["ctx"]
  },
  "else": {
    "properties": {
      "email": {
        "type": "object",
        "anyOf": [
          { "required": ["html"] },
          { "required": ["text"] }
        ]
      }
    },
    "not": {
      "required": ["ctx"]
    }
  }
}
