Skip to content

Custom Webhooks

Forward emails as JSON payloads to any external service using webhooks. You can use built-in templates for popular platforms or define your own custom payload format.

Plan requirement: Custom Webhooks is available on the Business plan and above.

How It Works

When MailFellow receives an email, it can send the email data as an HTTP POST request to one or more webhook URLs. This is useful for:

  • Sending notifications to services without a native MailFellow integration
  • Feeding email data into automation tools (Zapier, Make, n8n)
  • Logging emails to external databases or CRMs
  • Triggering workflows in custom applications

Creating a Webhook

  1. Go to Settings > Webhooks
  2. Click Create Webhook
  3. Fill in the details:
    • URL:the endpoint that will receive the POST request
    • Platform type:select a built-in template or "Custom"
  4. Click Save

Built-in Platform Templates

MailFellow includes pre-built payload templates for these platforms:

PlatformFormat
Microsoft TeamsAdaptive Card format for Teams incoming webhooks
TelegramTelegram Bot API sendMessage format (Markdown)
MattermostSlack-compatible incoming webhook format
CustomRaw JSON with all email fields

When you select a platform type, MailFellow automatically formats the payload to match that platform's expected format. For "Custom", the full email data is sent as JSON.

Webhook Payload

The default JSON payload includes these fields:

{
  "event": "new_email",
  "subject": "Meeting Tomorrow",
  "sender_name": "John Doe",
  "sender_email": "john@example.com",
  "body": "Full email body text...",
  "snippet": "Short preview of the email...",
  "thread_id": "thread_abc123",
  "timestamp": "2024-01-15T10:30:00Z",
  "cc_list": [
    {"name": "Jane", "email": "jane@example.com"}
  ],
  "account_id": "acc_123"
}

Custom Template Variables

If you write a custom template, you can use these Go template variables:

VariableDescription
{{.Subject}}Email subject line
{{.SenderName}}Sender's display name
{{.SenderEmail}}Sender's email address
{{.Body}}Full email body (plain text)
{{.Snippet}}Short preview/summary of the email
{{.ThreadID}}Email thread identifier
{{.Timestamp}}When the email was received
{{.AccountID}}The connected email account ID

Testing a Webhook

  1. Go to Settings > Webhooks
  2. Find your webhook in the list
  3. Click Test
  4. MailFellow sends a sample payload to your URL
  5. Check that your endpoint received it correctly

Using Webhooks with Routing Rules

You can combine webhooks with routing rules to send specific emails to specific webhooks. For example:

  • Route all invoices to an accounting webhook
  • Route support emails to a ticketing system webhook
  • Route VIP emails to a Slack webhook for a special channel

When creating a routing rule, set the webhook URL as the destination instead of (or in addition to) a channel.

Deleting a Webhook

  1. Go to Settings > Webhooks
  2. Click Delete next to the webhook

Any routing rules pointing to this webhook will stop forwarding to it, but the rules themselves are not deleted.