> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cradl.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Mailhook

> Trigger your Cradl AI agent by emailing documents to a dedicated address.

export const Row = ({children}) => {
  return <div className="flex gap-2 ">
    {children}
  </div>;
};

export const Image = ({style, ...rest}) => {
  let sizeStyle = {
    width: '75%'
  };
  return <Frame><img {...rest} style={{
    ...style,
    ...sizeStyle
  }} /></Frame>;
};

## Introduction

Use Mailhooks to send documents to your Cradl AI agent by email. Each agent gets a unique email address; any supported attachments sent to that address are processed automatically.

## Before you begin

* Have a Cradl AI agent ready to receive documents.
* Prepare a test document to email as an attachment.
* (Optional) Decide whether to restrict allowed senders for the trigger.

## Set up your Mailhook

Follow these steps to create the email trigger and test it with a sample document.

<Steps>
  <Step title="Add an Email trigger">
    In Cradl AI, open your agent and add a new trigger. Choose **Email** from the list of integrations. Copy the generated email address (for example, `12345678910@agent.cradl.ai`).
  </Step>

  <Step title="Restrict allowed senders (optional)">
    In the trigger settings, you can limit which email addresses are allowed to send documents. This helps prevent unwanted submissions.

    <Tip>Re-create the mailhook trigger or adjust the allowed senders list if the address is shared more broadly than intended.</Tip>
  </Step>

  <Step title="Send a test email">
    Email the mailhook address with one or more supported attachments. Example:

    ```
    To: 12345678910@agent.cradl.ai
    Subject: Invoice for July
    Attachments: invoice-july.pdf
    ```

    Supported attachments: PDFs, PNGs, JPEGs, WEBPs, and TIFFs.
  </Step>

  <Step title="Verify processing">
    Return to your agent and confirm the document run completed successfully. When processing finishes, the extracted data is available to any configured exports.
  </Step>
</Steps>

Your agent now receives documents sent to the mailhook address and processes them automatically.

## Troubleshooting

* No attachments: emails without attachments are ignored.
* Unsupported files: ensure attachments are a supported type and not password-protected.
* Not receiving documents: double-check the mailhook address and any allowed-sender restrictions.
* Forwarded messages: make sure your email client keeps attachments when forwarding (Gmail/Outlook work fine).

## FAQ

<AccordionGroup>
  <Accordion title="Can I forward emails from Gmail or Outlook?">
    Yes. Forwarding works as long as attachments are preserved by your email client.
  </Accordion>

  <Accordion title="What types of attachments are supported?">
    PDFs, PNGs, JPEGs, WEBPs, and TIFFs.
  </Accordion>

  <Accordion title="What happens if an email has no attachment?">
    The email is ignored and no parsing occurs.
  </Accordion>
</AccordionGroup>
