Server Plugin SDK
The Server plugin SDK builds on top of the popular Mail Attachment Downloader PRO Server rules engine and includes APIs that allows IT to natively extend the functionality of the Mail Attachment Downloader PRO Server to integrate it with other LOB or cloud applications.
Mail Attachment Downloader Plugin API allows extending the processing rules and actions performed for emails or attachments. A common scenario for its use would be to integrate email with other LOB (line of business) applications or cloud applications.
New in version 3.4
Not every integration needs a plugin. If your line-of-business or cloud application has a REST API, PRO Server can call it straight from a rule with the Run webhook action, and turn the JSON it answers into the text or values you need with Run Handlebars template. No DLL to build, nothing to install on the server.
A rule saves PDF attachments from billing@contoso.com. For each saved PDF it posts the invoice to the ERP's API, reads the ERP's answer, and emails the accounts team one line about it.
https://erp.example.com/api/v1/invoices?source={EMAIL_FROM}POST, application/jsonAuthorization: Bearer <your token>{RESULT_1}Payload, with the email's fields and an extracted value:
{
"supplier_email": "{EMAIL_FROM}",
"subject": "{SUBJECT}",
"invoice_no": "{INVOICE_NO}",
"received": "{DATE[yyyy-MM-dd]}",
"file_name": "{FILENAMEEXT}",
"message_id": "{MESSAGE_ID}"
}Fields inside quotes are JSON-escaped, so a subject such as Invoice "1001" for A&B keeps the JSON valid, and {EMAIL_FROM} is URL-encoded in the address. With a file, the request is multipart/form-data: the payload in a part named payload, the PDF in a part named file.
{
"id": "AP-2026-0412",
"status": "pending_approval",
"supplier": { "name": "Contoso Ltd" },
"total": "1290.00",
"approver": "finance@acme.example"
}The body goes into {RESULT_1}. A busy or unreachable ERP (no answer, HTTP 408, 429 or 5xx) is tried again after 2, 4 and 8 seconds. If it still fails, the call shows as failed and the rule's error actions run.
Source variable (the JSON to read):
{"erp": {RESULT_1}, "subject": "{SUBJECT}"}Template:
Invoice {{erp.id}} from {{{erp.supplier.name}}}: {{erp.total}} EUR
{{#if erp.approver}}Waiting for {{erp.approver}}{{else}}Booked{{/if}} ({{{subject}}})Output variable {ERP_LINE} becomes:
Invoice AP-2026-0412 from Contoso Ltd: 1290.00 EUR Waiting for finance@acme.example (Invoice "1001" for A&B)
Add actions under the template and they run with its result: Send email to the accounts team with {ERP_LINE} as the subject, rename the PDF to {ERP_ID}.pdf with a second template ({{id}} from {RESULT_1}), or save the ERP's ID next to the email with Save to database.
Test webhook sends one call with the settings on screen and a sample email's values, and shows the answer. "Test this rule..." runs Handlebars templates and says what a webhook would do (Would call POST erp.example.com) without calling it.
Installation
