@itentialopensource/adapter-email
Version:
Email notification adapter
210 lines • 5.86 kB
JSON
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "adapter-email",
"type": "object",
"description": "The properties object for adapter-email",
"properties": {
"auth": {
"$ref": "#/definitions/auth"
},
"service": {
"description": "Use SMTP connection details for several well-known providers (https://nodemailer.com/smtp/well-known/)",
"type": "string",
"default": "",
"examples": [
"FastMail",
"Postmark",
"Gmail"
]
},
"host": {
"description": "Hostname or IP address to connect to (defaults to ‘localhost’)",
"type": "string",
"default": "localhost"
},
"port": {
"description": "The port to connect to (defaults to 587 if secure is false or 465 if true)",
"type": "number",
"default": 587,
"examples": [
25,
465,
587
]
},
"secure": {
"description": "Use TLS",
"type": "boolean",
"default": true
},
"tls": {
"description": "Defines additional node.js TLSSocket options to be passed to the socket constructor",
"type": "object",
"properties": {
"rejectUnauthorized": {
"description": "If not false the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true",
"type": "boolean",
"default": true
}
},
"additionalProperties": false
},
"subscriptions": {
"$id": "/subscriptions",
"type": "array",
"description": "Events to subscribe.",
"items": {
"type": "string",
"description": "email event",
"examples": [
"email-event-unseen"
]
}
},
"incomingEmailSizeLimit": {
"type": "number",
"description": "Maximum size allowed for incoming email when listening to emails, minimum is 0 bytes, maximum is 1,000,000 bytes (~1MB)",
"default": 10000,
"minimum": 0,
"exclusiveMaximum": 1000001
},
"displayName": {
"type": "string",
"description": "Email display name/subject"
},
"logger": {
"description": "If set to true then logs to console. If value is not set or is false then nothing is logged",
"type": "boolean"
},
"debug": {
"description": "If set to true, then logs SMTP traffic, otherwise logs only transaction events",
"type": "boolean"
},
"tokenRequest": {
"description": "Token request info",
"type": "object",
"properties": {
"request": {
"type": "object",
"description": "Request info",
"properties": {
"url": {
"type": "string",
"description": "The url used to get token",
"examples": [
"https://<server>/oauth2/v2.0/token"
]
},
"body": {
"type": "object",
"description": "Body fields of the request"
},
"headers": {
"type": "object",
"description": "Headers of the token request"
},
"method": {
"type": "string",
"string": "Request method",
"default": "",
"enum": [
"POST",
"GET"
]
}
}
},
"response": {
"type": "object",
"description": "Response info used to map system fields with nodemailer fields"
}
}
}
},
"required": [],
"anyOf": [
{
"required": [
"service"
]
},
{
"required": [
"host",
"port",
"secure"
]
}
],
"additionalProperties": false,
"definitions": {
"auth": {
"description": "Authorization information for an email account",
"type": "object",
"properties": {
"type": {
"description": "Authentication type",
"type": "string",
"enum": [
"OAuth2",
"custom"
]
},
"user": {
"description": "The default username to send from",
"type": "string"
},
"pass": {
"description": "The password for the default username",
"type": "string"
},
"clientId": {
"description": "The registered client id of the application",
"type": "string"
},
"clientSecret": {
"description": "The registered client secret of the application",
"type": "string"
},
"serviceClient": {
"description": "Service client id",
"type": "string"
},
"privateKey": {
"description": "The private key contents",
"type": "string"
},
"refreshToken": {
"description": "Optional refresh token. If it is provided then Nodemailer tries to generate a new access token if existing one expires or fails",
"type": "string"
},
"accessToken": {
"description": "Access token for the user",
"type": "string"
},
"expires": {
"description": "Optional expiration time for the current accessToken",
"type": "integer"
},
"accessUrl": {
"description": "Optional HTTP endpoint for requesting new access tokens. This value defaults to Gmail",
"type": "string"
}
},
"if": {
"properties": {
"type": {
"const": "OAuth2"
}
}
},
"then": {
"required": ["user"]
},
"else": {
"required": ["user", "pass"]
},
"additionalProperties": false
}
}
}