3.1 AgentMail Configuration
Setting up the Ears.
We use AgentMail.to because it parses messy emails into clean JSON for us.
Access AgentMail Documentation here: https://docs.agentmail.to/welcome
Step 1: Provision the Inbox
Log in to your AgentMail Dashboard.
Create a new Organization: DealTrail.
Create a new Inbox:
Address:
tc(which becomestc@dealtrail.agentmail.toor your custom domain).Name: "DealTrail Central".
Step 2: Connect the Webhook
We need AgentMail to "push" emails to n8n instantly.
Open n8n.
Create a new Workflow called "01 - Ingestion Router".
Add a Webhook node.
Method: POST.
Path:
/webhook/ingest.Copy the Production URL.
Go back to AgentMail.
Navigate to Webhooks settings.
Add Webhook: Paste your n8n URL.
Events: Select
message.created.
Step 3: Verify the Payload
Send a test email to your new address. In n8n, you should see a JSON object like this:
{ "from": "agent@gmail.com", "subject": "Fwd: Contract for 123 Maple", "body": "Hi Amy, see attached.", "attachments": [ { "filename": "RPA_123_Maple.pdf", "url": "https://agentmail.to/..." } ]}
Developer Note: We use the attachments array heavily. Ensure your n8n flow downloads these files immediately as the temporary links expire.