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

# n8n Integration

> How to connect Mailofly with n8n to automate notifications, lead alerts, and transactional emails.

# n8n Mailofly Integration

[n8n](https://n8n.io) is a powerful workflow automation tool. You can easily integrate Mailofly into your n8n workflows using the built-in HTTP Request node to send transactional emails, trigger campaigns, and parse inbound messages.

***

## 1. Create a Generic Credential in n8n

1. In n8n, go to **Credentials** > **New Credential**.
2. Select **Header Auth**.
3. Set **Name**: `Mailofly API`.
4. Set **Header Name**: `Authorization`.
5. Set **Value**: `Bearer mf_live_your_api_key`.

***

## 2. Configure the HTTP Request Node

1. Add an **HTTP Request** node to your n8n workflow.
2. Configure the parameters:
   * **Method**: `POST`
   * **URL**: `https://api.mailofly.com/api/v1/emails`
   * **Authentication**: Select your `Mailofly API` Header Auth credential.
   * **Send Body**: Enabled (`JSON`).
3. Set the JSON Body:
   ```json theme={null}
   {
     "from": "Acme Notifications <notifications@yourdomain.com>",
     "to": "={{ $json.customer_email }}",
     "subject": "Order Confirmed #={{ $json.order_id }}",
     "html": "<h3>Thanks for your purchase!</h3><p>Total: ${{ $json.amount }}</p>"
   }
   ```

***

## 3. Test and Activate

Click **Test step** in n8n. Verify the 200 response containing the generated email `id`.


## Related topics

- [Integrations](/integrations/index.md)
- [SDKs & Integrations](/sdks/index.md)
- [Client Integration Guides](/mcp-server/clients.md)
- [Index](/changelog/index.md)
- [MCP Server](/mcp-server/introduction.md)
