Incoming Email via API
Email Configuration – Incoming Alemba API
Last updated
Email Configuration – Incoming Alemba API
Last updated
Create your new Incoming email server source, see Adding a New Server
Select the “Alemba API” protocol is available to select when creating a new incoming email server:
If you cannot see the Alemba API email protocol, please contact Alemba Support.
“Email Server Id” will contain a value. This value is needed when creating requests to add emails via the API.
The remaining fields are the standard incoming email fields.
During the Logic App Configuration, you will need to link to the ReplaceInlineImages Azure function.
This action will pass the attachment name, ref and the HTML version of the description to the ReplaceInlineImages functions and will return the updated HTML version of the description, to include the inline image.
You will need to create a function app and the function itself. Please contact Alemba Support if you require assistance.
You will not be able to see or modify the code within the Azure Portal, so if any modifications are needed, they will need to be done in VS Code and redeployed.
Create a Logic App with the “When a new email arrives (V3)” Office 365 Outlook trigger.
The “Include Attachments” parameters needs to be enabled.
Add an “Initialize variable” action where the variable name is Attachments and the type is array:
Add an “Initialize variable” action where the variable name is BodyHtml and the type is string:
Add a “For each” action which will loop through the Attachments from the trigger and will append the Attachments Content, Attachments Name and Attachments Is Inline values to the attachments array:
Add a “Condition” action within the “for each” action that will check whether the Attachments Is Inline value is equal to true:
Go into the settings of the “for each” action and set the concurrency control limit to 1:
Under the “True” side of the condition, add the following actions:
Link to the ReplaceInlineImages Azure function
This action will pass the attachment name, ref and the HTML version of the description to the ReplaceInlineImages functions and will return the updated HTML version of the description, to include the inline image. Please refer to Part 1 for more information
Set the BodyHtml variable with the DescriptionHtml
Outside of the “for each” loop, add a new “Http” action that will post the data to the Alemba API.
You will need to add any necessary authentications. The endpoint url will follow this format: https://{Server Endpoint}/{System Name}/alemba.api/api/v2/email-incoming/
The “EmailServerId" parameter is the “Email Server Id” value from the email server settings in ASM.