When to Use Mailhook vs an Email Trigger
A decision guide for picking the right email-based trigger in Spojit: use a Mailhook when you control where mail is sent, and use an Email trigger when mail already lands in a Gmail or Outlook mailbox you own.
Overview
Spojit gives you two ways to start a workflow from email, and they solve different problems. The Mailhook trigger generates a unique Spojit address that you point mail at directly, so a run starts the moment a message arrives. The Email trigger instead watches an existing Gmail or Outlook mailbox you already own and polls it for new messages on a schedule. Both put the parsed message into your workflow, but the question of which to choose comes down to one thing: who decides where the mail goes.
The mental model is about the source of the mail, not the format of the message. If you can change a vendor's notification address, set up a forwarding rule, or aim a system's outbound mail at an address of your choosing, a Mailhook is the cleaner fit because it needs no mailbox and no sign-in. If the mail already arrives in a human inbox you read, or you cannot change where the sender delivers it, the Email trigger lets you connect that mailbox and process matching messages without moving anything. This guide walks through how to tell the two apart and how to wire up whichever one fits.
Choose a Mailhook When You Control the Destination
Pick the Mailhook trigger when you can decide where the mail is sent. Spojit generates a unique address in the form <prefix>-<random>@mailhook.spojit.com, and any message delivered to it starts a run within seconds. There is no mailbox to connect and no sign-in to maintain. Typical cases:
- Vendor and system notifications where you can edit the recipient address, such as order confirmations, shipping updates, or report exports that a platform emails out.
- Forwarding rules where you set up an existing inbox to auto-forward a subset of mail (for example, anything from a supplier) on to the Mailhook address.
- Machine-generated mail from monitoring tools, scanners, or internal systems that send to a fixed address you configure once.
To set one up, open the trigger node, set Trigger Type to Mailhook, optionally enter an Address prefix (1 to 24 characters, default mh), click Generate email address, copy the address, and point your mail source at it. The run is always asynchronous: the sender gets no reply, so to respond you add a Send Email node and target {{ input.replyTo }}. The incoming message is available as {{ input }} with fields such as from, subject, text, html, and attachments.
Choose an Email Trigger When Mail Lands in a Mailbox You Own
Pick the Email trigger when the mail already arrives in a Gmail or Outlook mailbox you control and you cannot, or do not want to, redirect it. The trigger polls that mailbox and starts a run for each new matching message. Typical cases:
- A shared team inbox like
support@ororders@that people also read, where moving the mail elsewhere is not an option. - Senders you cannot reconfigure, such as customers emailing your published address, where the only place the mail exists is your mailbox.
- Mailboxes that already have organization, where you want to process only one folder or label rather than everything that arrives.
To set one up, first add the mailbox under Connections using Add connection and choosing Gmail (trigger) or Outlook (trigger), which signs in read-only by default. Then in the trigger node set Trigger Type to Email, pick the connected mailbox and folder, set a poll interval (1 to 60 minutes, default 2), and optionally add a From allowlist and Subject regex. The message is exposed with fields like from, subject, textBody, htmlBody, and attachments.
Quick Decision Checklist
- Can you change where the mail is sent? Yes, use a Mailhook. No, use the Email trigger.
- Do you want to avoid connecting and re-authorizing a mailbox? Mailhook needs no sign-in; the Email trigger needs a Gmail or Outlook connection.
- How fast must it react? Mailhook fires within seconds of delivery; the Email trigger reacts on its next poll, up to your interval apart.
- Does the mail need to keep living in a human inbox? If yes, the Email trigger reads in place; a Mailhook is a destination of its own.
Tips
- If you choose a Mailhook but the mail only exists in an inbox today, you can still use it: add a forwarding rule in that mailbox so matching messages flow to the Mailhook address, which gives you near-instant runs without connecting the mailbox to Spojit.
- Both triggers support a From allowlist and a Subject regex filter, so you can narrow either one to just the messages you care about rather than building filtering logic inside the workflow.
- You can describe your goal to Miraxa, the intelligent layer across your automation, with a prompt like "Build a workflow that watches a mailhook, extracts the PDF invoice, and posts a summary to Slack," then fine-tune the trigger in the properties panel.
- Need attachment bytes from a Mailhook message? Add an Attachment node, which works only in Mailhook workflows, to fetch the actual file content for a Send Email or Knowledge node.
Common Pitfalls
- Expecting a reply to the sender from a Mailhook. Mailhook runs are always asynchronous and send no automatic response. To answer, add a Send Email node addressed to
{{ input.replyTo }}. - Mismatched field names between the two triggers. The Email trigger exposes
textBodyandhtmlBody, while the Mailhook exposestextandhtmlunder{{ input }}. Reference the correct field for the trigger you chose. - Forgetting the mailbox connection for the Email trigger. The Email trigger cannot poll until you add the Gmail (trigger) or Outlook (trigger) connection under Connections first.
- Treating poll interval as instant. The Email trigger only checks on its schedule, so a 60-minute interval can delay a run by up to an hour. Use a Mailhook when seconds matter.
Related Articles
- Setting Up a Mailhook Trigger
- Setting Up an Email Trigger
- Webhook vs Mailhook: Which Trigger Should I Use?
- Filtering Mailhook Emails