Three rule actions connect Mail Attachment Downloader PRO to the rest of your tools. Run Webhook calls any web address with the email's details and files, Run AI prompt asks ChatGPT or Claude about the email and its attachments, and Run Handlebars template turns the JSON they answer into the text you need. Each answer goes into a field that the actions after it can use.
Add the actions to a rule's actions in the rule window. They run for each file the rule saves, or once for each email.
Your filters pick the emails and attachments: a sender, a subject, a type of file.
{SUBJECT}, {FROM}, an extracted invoice number or an earlier answer, each escaped for where it goes.
To your web address, or to ChatGPT or Claude, with the files if you want. A busy service is tried again.
It goes into a field such as {RESULT_1}, and the actions under this one run with it.
Type a field anywhere in the web address, a header, the payload or the prompt, or pick one with the button next to the payload or the prompt. The list shows the email's fields, your extractions, and the answers of earlier actions.
{SUBJECT}, {FROM}, {EMAIL_FROM} (the address only), {TO} and {CC}{DATE}, or the date in your format, such as {DATE[yyyy-MM-dd]}{FILENAMEEXT} (the saved file's name), {FILENAME}, {EXT} and {SAVE_FILE} (its full path){EMAIL_BODY}, {ACCOUNT_EMAIL}, {MESSAGE_ID} and any header, such as {EMAIL_HEADER[X-Order-Id]}{INVOICE_NO}, and the answers of earlier actions, such as {RESULT_1}?subject={SUBJECT} stays one parameter even with an & in the subject. An address that is only a field, such as {RESULT_1}, goes in as it is.<, >, & and quotes are escaped.{
"subject": "{SUBJECT}",
"from": "{EMAIL_FROM}",
"file": "{FILENAMEEXT}",
"invoice": "{INVOICE_NO}",
"order": {RESULT_1}
}{
"subject": "Invoice \"1001\" for A&B",
"from": "billing@supplier.com",
"file": "invoice_1001.pdf",
"invoice": "1001",
"order": {"id": 42, "status": "open"}
}{RESULT_1} (here the JSON an earlier webhook answered) goes in as JSON.Send the email's details, and its files if you want, to your own system, a Power Automate, Zapier or Make flow, a ticketing tool or any REST API.
https://api.example.com/invoices?from={EMAIL_FROM}. Use https.Authorization: Bearer <your token> or X-Api-Key. Fields work here too.{RESULT_1}, for the actions after it.A call is tried again when the address can't be reached, no answer comes within the timeout, or the answer is HTTP 408, 429 or a server error (5xx). It waits 2 seconds, then 4, 8 and so on, 30 at most, up to "Num retries" more times, and stops when the download is cancelled. Other answers, such as 400, 401 or 404, aren't retried: the same request would get the same answer.
Tip: a retried POST is sent again in full. If your endpoint creates records, have it ignore a repeat, for example by {MESSAGE_ID}.
The status list shows the call as failed, with the answer it got:
Run webhook action failed: HTTP 500 (Internal Server Error) (after 4 attempts)
The rule's error actions run, and the actions under the webhook don't.
Sends one call with the settings on screen, with a sample email's values in the fields and no retries, and shows the answer.
multipart/form-data: the payload in a part named payload, and each file in a part named file.Summarize an invoice, sort a request, read the values a regular expression can't, or draft a reply.
{AI_RESULT}.From: {EMAIL_FROM} Subject: {SUBJECT} Read the attached invoice. Answer only with JSON: {"supplier": "", "invoice": "", "total": 0, "due": "yyyy-mm-dd"}
A network error is tried again up to 3 times. Other errors, such as a wrong API key, end the action at once, so the prompt isn't sent, and paid for, again. The rule's error actions run.
Sends the prompt as typed, without an email, to check the key and the model.
Webhooks and AI often answer with JSON. A Handlebars template picks out what you need and writes it your way: a line for an email, a file name, a value for a database.
{RESULT_1} alone, or {"order": {RESULT_1}, "subject": "{SUBJECT}"}.{{order.id}}, {{#if paid}}...{{/if}} or {{#each items}}...{{/each}}. {{name}} escapes HTML characters (an & becomes &); use {{{name}}} for plain text. Put the email's fields in the source variable, not in the template.{ORDER_LINE}.Source variable {"order": {RESULT_1}, "subject": "{SUBJECT}"} Template Order {{order.id}} for {{{order.customer}}}: {{order.total}} EUR ({{{subject}}}) Output variable {ORDER_LINE} Order 42 for ACME Ltd: 129.90 EUR (Invoice "1001" for A&B)
{"id": 42, "customer": "ACME Ltd", "total": 129.90} into {RESULT_1}. Handlebars templates also run in "Test this rule...", so you can check one before a download."Run action when": Once per file saved (the default) runs it for each file the rule saves, with that file's fields. Once per email runs it once the email is processed, with the email's fields. Both once per email and once per file saved does both.
Actions added under a webhook, an AI prompt or a template run after it, with its answer in its field: for example AI prompt, then a Handlebars template, then Send email with {SUMMARY}. Once per email, they run once the email is processed too.
Once per email, these actions don't run for an email that couldn't be processed. To report such emails, add the action to the rule's error actions instead: there it runs because the email failed, and {ERROR_MESSAGE} says why.
A test doesn't call webhooks or AI services. It says what it would do, for example Would call POST api.example.com. Handlebars templates run in a test.
PDF attachments from billing@supplier.com.
Reads the invoice and answers JSON into {INVOICE_JSON}.
Posts {"invoice": {INVOICE_JSON}, "file": "{FILENAMEEXT}"} to your accounting system.
Writes "Invoice 1001 from ACME booked" and emails it to the team.
Calls go from your PC or server directly to the web address or the AI service you set. Nothing goes through Gearmage.
Bug reports you send us leave out webhook addresses (all but the server's name), header values and AI API keys.
"Test this rule..." names only the server a webhook would call, never its full address, where tokens often are.
Use https addresses. When the service lets you, put the token in a header (Authorization) rather than in the address, and give it only the permissions it needs.
Mail Attachment Downloader PRO Server. The actions run in the desktop app and in the Windows service. See plans and pricing.
Yes, also when nobody is signed in. The service gets a copy of all your settings, rules included, when it's installed. After you change a rule, the Service tab shows "⚠ Reinstall to apply changes": reinstall the service there, and it runs the changed rule from then on.
Save the answer in a field, then pick the value with a Handlebars template: Source variable {RESULT_1}, Template {{project.id}}, Output variable {PROJECT_ID}. To pass the whole answer on, put it in another webhook's JSON payload, outside quotes.
Yes: Run Webhook with the channel's incoming webhook address and the JSON the app expects, for example {"text": "New invoice from {EMAIL_FROM}: {SUBJECT}"} for Slack.
One file and no payload: the file itself, with its content type. Otherwise a multipart/form-data request, with the payload in a part named payload and each file in a part named file.
You pay OpenAI or Anthropic for what you use, with your own key. Prompts with files cost more. When one answer per email is enough, run the prompt once per email rather than once per file.
It's tried again as "Num retries" says. Then the status list and Download History show it as failed, and the rule's error actions run, for example to move the email to a folder to look at later.
These PRO features often go with webhooks and AI prompts.
Only call out for emails from a sender, with a subject, or with a type of attachment.
Send an invoice number or a total, not the whole email.
Look up a customer before you call the API, or save the answer.
Mail the AI's summary, or a template's text, to your team.
Move an email aside and tell someone when a call fails.
Run 24/7, unattended, in the cloud or on-premises, even without a user signed in.
Get Mail Attachment Downloader PRO Server and connect your mailbox to your APIs, ChatGPT or Claude, without writing a line of code.