{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.whispir.com/sparx-message-transactions/email-1.0.0",
  "title": "Sparx Message Transactions Email events",
  "description": "A schema for a sparx email message transaction events",
  "type": "object",
  "properties": {
    "schema": {
      "type": "string"
    },
    "metadata": {
      "$ref": "../event-0.0.0#/$defs/metadata"
    },
    "source": {
      "$ref": "../event-0.0.0#/$defs/appDetails"
    },
    "event": {
      "type": "object",
      "properties": {
        "eventType": {
          "type": "string",
          "enum": [
            "MESSAGE_TRANSACTION_EMAIL",
            "MESSAGE_TRANSACTION_EMAIL_REPLY",
            "MESSAGE_TRANSACTION_EMAIL_STATUS_SENT"
          ]
        },
        "message": {
          "properties": {
            "messageId": {
              "type": "string"
            },
            "companyId": {
              "type": "string"
            },
            "workspaceId": {
              "type": "string"
            },
            "contactId": {
              "type": "string"
            },
            "emailRecipient": {
              "type": "string",
              "format": "email"
            },
            "emailSubject": {
              "type": "string"
            },
            "messageRequestId": {
              "type": "string"
            }
          },
          "required": [
            "messageId",
            "workspaceId",
            "contactId",
            "emailRecipient",
            "emailSubject",
            "messageRequestId"
          ]
        }
      },
      "required": ["eventType", "message"]
    }
  },
  "required": ["schema", "metadata", "source", "event"]
}
