Outgoing Email via Webhooks

Email Configuration – Outgoing Webhook as of version 10.5

A “Webhook” protocol is available to select when creating a new outgoing email server.

Create a new Outgoing Webhook Server

  1. Access Admin>System Administration>System>Email Settings

  1. In the Outgoing Email section of the Email Settings window, click Add, to create a new server. To modify an existing configuration, highlight the row and click Open. Here, you can also test the configuration.

  1. Select the 'Webhook' Protocol from the list. If the Webhook protocol is not listed, please contact Alemba Support for assistance to add the protocol.

  1. Configure the Webhook widget:

  • Payload URL – This is the webhook endpoint. E.g. the endpoint of the Azure Logic App.

  • Secret – This is an optional parameter which will be passed within the webhook request header. It can be used for extra security at the webhook endpoint.

  1. When emails are sent, they will appear as recent deliveries. You can check whether they were successful or not. You can also redeliver previous deliveries.

Logic App Configuration

  1. Create Logic App with an HTTP Trigger.

  2. Paste the following into the Request Body JSON Schema field of the trigger:

{
    "properties": {
        "Action": {
            "type": "string"
        },
        "Email": {
            "properties": {
                "Attachments": {
                    "items": {
                        "properties": {
                            "FileData": {
                                "type": "string"
                            },
                            "FileName": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "FileName",
                            "FileData"
                        ],
                        "type": "object"
                    },
                    "type": "array"
                },
                "Bcc": {
                    "type": "string"
                },
                "BodyHtml": {
                    "type": "string"
                },
                "BodyPlainText": {},
                "Cc": {
                    "type": "string"
                },
                "From": {
                    "type": "string"
                },
                "FromAddress": {},
                "FromName": {},
                "Priority": {
                    "type": "string"
                },
                "ReceiptRecipient": {},
                "ReplyTo": {
                    "type": "string"
                },
                "Subject": {
                    "type": "string"
                },
                "To": {
                    "type": "string"
                }
            },
            "type": "object"
        }
    },
    "type": "object"
}

3. Add an “Initialize variable” action where the variable name is attachment and the type is array:

4. Add a “For each” action which will loop through the Attachments from the trigger and will append the FileData and FileName to the attachment array:

5. Add a “Send an email (V2)” action. Configure the connection details to the email server and fill it out as per this screenshot:

6. Add a “Response” action to return a 200 status code and a message to say the email had been processed successfully.

Last updated