Server Plugin SDK

Mail Attachment Downloader PRO 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.

Key Benefits

  • Tighter integration with LOB or cloud application
  • Reduce development costs
  • Reduce development time from months to days
  • Improve quality and reliability
  • Better track errors and exceptions
  • Reduced time to market
  • Reduced deployment cost and times
Get the Pro Version

Some common use cases

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.

  • Integrate with electronic document management systems
  • Integrate with invoicing or workflow software
  • Integrate with cloud-based solutions
  • Integrate with SAP or ERP offerings
  • and more...
Documentation

New in version 3.4

Integrate without code: webhooks and Handlebars templates

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.

Use a webhook when…

  • Your system has a REST API, or a Power Automate, Zapier or Make flow in front of it
  • You need to send the email's fields, extracted values and saved files to it
  • You want to use its answer later in the rule: in a file name, an email, a database or another call
  • You'd rather set it up in the rule window than write and deploy code

Use the SDK when…

  • You need to change how the program behaves at a stage, such as filtering, extraction or downloading, not only after a file is saved
  • The system you integrate with has no web API, only a .NET library, a COM object or a local database
  • The logic is more than one call and a template, or must run in-process
  • You want to package an integration once and reuse it on many servers

Example: book each invoice in your ERP

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.

1

Run webhook: send the invoice

Full URL
https://erp.example.com/api/v1/invoices?source={EMAIL_FROM}
Method / Content Type
POST, application/json
HTTP Headers
Authorization: Bearer <your token>
Include files
from parent action (the PDF the rule saved)
Save response in field
{RESULT_1}
Timeout / Num retries
30 seconds, 3 retries

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.

2

The ERP answers

{
  "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.

3

Run Handlebars template: write it your way

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)
4

Use the answer in the next actions

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.

✓

Check it before it runs

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.

Mail Attachment Downloader PRO Server, version 3.4 (build 1038 and later). Webhooks and templates are part of PRO Server and don't need the SDK license. They run in the desktop app and in the Windows service. Calls go from your server straight to your API, never through Gearmage. Also in 3.4: Run AI prompt asks ChatGPT or Claude about each email and its attachments, and its answer can feed a template or a webhook in the same way.

Installation

SDK Installation Guide

  • When you purchase the license with SDK, you are provided a link to download a ZIP file. The zip file includes an SDK folder that has a Help folder and a Sample project within. The Help includes SDK documentation that is also available online through this site (see below).
  • The Sample project builds to a 32-bit (x86) C# DLL called MailAttachmentDownloaderPlugin.dll that MUST be placed in the installation directory for the program. Note: the 32-bit build will require a 32-bit PRO Server. PRO Server can also be installed as a 64-bit binary from the license, in which case you will need to change the sample project to a 64-bit build to be compatible. This DLL is then dynamically loaded by the program at runtime.
See Documetation
SDK Installation Guide

Plugin SDK Documentation