{
  "schema": "1.0",
  "name": "OpenC Mailer",
  "link": "https://connectors.openc.nl",
  "description": "Send email through SMTP via Claris Connect.",
  "auth_components": {
    "type": "none"
  },
  "requiredSettings": {
    "authFields": [
      {
        "label": "API token",
        "key": "token",
        "description": "Your API token for OpenC Mailer for Claris Connect"
      },
      {
        "label": "Hostname",
        "key": "hostname",
        "description": "Hostname of your SMTP server"
      },
      {
        "label": "Port number",
        "key": "port",
        "description": "Which SMTP port to connect to.",
        "choices": {
          "465": "465",
          "587": "587"
        }
      },
      {
        "label": "Email address",
        "key": "address",
        "description": "Email address of your account."
      },
      {
        "label": "Username",
        "key": "username",
        "description": "Username (leave empty to use email address)."
      },
      {
        "label": "Password",
        "key": "password",
        "description": "Password of your email account.",
        "masked": true
      }
    ]
  },
  "auth_request": {
    "type": "custom_body",
    "errorMessageKey": "detail",
    "body_parameters": {
      "token": "{{authFields.token}}",
      "hostname": "{{authFields.hostname}}",
      "port": "{{authFields.port}}",
      "address": "{{authFields.address}}",
      "username": "{{authFields.username}}",
      "password": "{{authFields.password}}"
    }
  },
  "testConnection": {
    "endpoint": "/test",
    "method": "POST",
    "body": {}
  },
  "endpoints": {
    "POST": {
      "/test": {
        "url": "https://connector-backend.smartyellow.net/mailer/"
      },
      "/send": {
        "url": "https://connector-backend.smartyellow.net/mailer/"
      }
    }
  },
  "actions": [
    {
      "modelId": "email",
      "actionId": "send",
      "endpoint": "/send",
      "method": "POST",
      "label": "Send an email via SMTP",
      "helpText": "Send an email through your SMTP server.",
      "urlFields": [],
      "actionFields": [
        {
          "key": "from",
          "label": "From address",
          "description": "Sender email address. Leave empty to use your username. You can use this notation to set the sender name (with quotes): <code>\"Name\" &lt;my@email.com&gt;</code>",
          "type": "string",
          "required": false
        },
        {
          "key": "to",
          "label": "Recipients",
          "description": "Comma-separated list of recipient addresses.",
          "type": "string",
          "required": true
        },
        {
          "key": "subject",
          "label": "Subject",
          "description": "The subject of the email to send.",
          "type": "string",
          "required": true
        },
        {
          "key": "text",
          "label": "Text",
          "description": "Enter the body text of the email to send. If you set the HTML field, you can leave this field empty; the text will be extracted from the HTML.",
          "type": "text",
          "required": false
        },
        {
          "key": "html",
          "label": "HTML",
          "description": "Provide the HTML of the email to send. Optional if you provide a plaintext body.",
          "type": "text",
          "required": false
        },
        {
          "key": "replyTo",
          "label": "Reply to",
          "description": "If specified, this email address will be used by email clients as the recipient when replying to this email.",
          "type": "string",
          "required": false
        },
        {
          "key": "attachments",
          "label": "Attachments",
          "description": "JSON object with attachment names (keys) and download URLs (values). The referenced files will be attached within the email.",
          "type": "JSON",
          "required": false
        }
      ]
    }
  ]
}
