Send email from Mixpanel when a meaningful product event happens—not when someone merely appears in an analytics report. This guide shows the reliable integration pattern: Mixpanel Real-Time Event Streams sends a selected event to your webhook, and your server maps that event into a Volanea API email.

There is one important limitation up front: Volanea does not have a native Mixpanel app, Marketplace listing, or one-click plugin. Mixpanel’s outbound event-webhook capability is called Real-Time Event Streams, and it is currently a limited-access beta rather than a feature to assume is enabled in every Mixpanel project. If your project has access, it can deliver individual matching events to an HTTPS endpoint you control; that endpoint should then call Volanea. Do not point Mixpanel directly at Volanea with a Volanea secret key in a template or client-visible configuration.

The result is a small but production-ready pipeline:

  1. Your product tracks a Mixpanel event such as Trial Started.
  2. A Mixpanel Real-Time Event Stream filters for that event and POSTs a deliberately small JSON payload to your server.
  3. Your webhook validates the request, checks required fields, and uses the Mixpanel event’s insert ID as an idempotency key.
  4. Your server calls POST https://api.volanea.com/v1/send.
  5. Volanea accepts, suppresses, renders, tracks, and dispatches the message through your verified sending domain.

What actually triggers an email in Mixpanel

The concrete trigger in this integration is a Mixpanel event. For the example below, the event is named Trial Started and is tracked when an account successfully begins a trial.

That wording matters. Mixpanel Real-Time Event Streams do not watch for a generic “record created,” “stage changed,” or “form submitted” object unless your application tracks one of those actions as an event. Your application decides which behavior deserves a message, then sends that event to Mixpanel with the properties needed for the email workflow.

A server-side product flow might track the event like this:

// Your application server, after the trial has actually been created.
// Track only after the business action succeeds.
mixpanel.track("Trial Started", {
  distinct_id: user.id,
  $insert_id: crypto.randomUUID(),
  email: user.email,
  first_name: user.firstName,
  plan: "pro",
  trial_ends_at: trial.endsAt.toISOString(),
  locale: user.locale ?? "en"
});

The event name is your business contract. Avoid triggering an onboarding email from a loose event such as Page View, Clicked CTA, or Signup Form Opened. Those actions can happen repeatedly, can be recorded by anonymous visitors, and may precede a valid email address or an actual account. Trial Started is preferable because it represents a completed state change in your application.

Mixpanel lets a Real-Time Event Stream select one or more event types and optionally apply property conditions. There is no default “send every event” mode. That is useful: a narrowly defined trigger protects your sending reputation, avoids surprise volume, and makes it easier to explain why a recipient received a message.

Choose a trigger with an email-worthy outcome

A good Mixpanel-to-email trigger should satisfy all of the following:

  • It is emitted after—not before—the underlying action succeeds.
  • It identifies one intended recipient through a valid email property.
  • It includes a stable event identifier for deduplication.
  • It has a clear customer expectation, such as a welcome, receipt, access notice, or trial reminder.
  • It does not convert analytics noise into unsolicited marketing email.

For a trial welcome email, a sensible filter is:

  • Event type: Trial Started
  • Property condition: plan equals pro
  • Optional property condition: email exists

The email address should usually come from your own authenticated application data, not from a browser field that has not been verified. If a client-side event supplies an email property, treat it as untrusted input until your webhook validates it or reconciles it with your account system.

The integration architecture: Mixpanel, your relay, then Volanea

A direct analytics-to-email call sounds convenient, but it is not the right security boundary. Mixpanel needs permission to deliver an outbound webhook to your endpoint. Volanea needs a secret API key to send from your domain. Your relay is where those two responsibilities meet safely.

Application
  └── tracks “Trial Started” in Mixpanel
        └── Mixpanel Real-Time Event Stream
              └── POST /webhooks/mixpanel/trial-started
                    └── validate + deduplicate + map fields
                          └── POST https://api.volanea.com/v1/send
                                └── accepted email and delivery events

Mixpanel Real-Time Event Streams are designed for individual events that need downstream action within seconds. Mixpanel documents at-least-once delivery, automatic retries for transient failures, and a p95 delivery target of 120 seconds from ingestion to a confirmed 2xx response under normal conditions. That makes the feature suitable for behavioral activation, but it also means duplicate protection is mandatory.

Your server-side relay does five jobs that Mixpanel should not do for you:

  1. Authenticates Mixpanel’s webhook request.
  2. Validates data before an email API call is made.
  3. Normalizes fields such as name, locale, plan, and timestamp.
  4. Makes delivery idempotent when Mixpanel retries a request.
  5. Keeps the Volanea key private in a server secret store or environment variable.

This is not needless infrastructure. It is the point at which you can reject malformed events, enforce consent, avoid email to missing addresses, log correlation IDs, and make a time-sensitive webhook response fast without exposing a mail credential.

Before you configure the Mixpanel stream

You need four things before enabling the flow.

1. Access to Mixpanel Real-Time Event Streams

Mixpanel describes Real-Time Event Streams as a beta feature available to a limited set of customers. If the Real-Time Event Streams area is not available in your Mixpanel project, ask your Mixpanel account team about access rather than searching for a nonexistent native Volanea connector.

Do not confuse this feature with Mixpanel Cohort Sync custom webhooks. Cohort Sync exports audience membership changes and full or incremental cohort data. It is useful for audience synchronization, but it is not the same as reacting to each individual product event as it arrives.

2. An HTTPS endpoint you control

Use a public HTTPS endpoint such as:

https://app.example.com/webhooks/mixpanel/trial-started

The endpoint must accept POST requests and return a 2xx response when it has safely accepted the work. For high-volume production traffic, accept the request, persist or enqueue it, and return promptly. Do not wait for unrelated slow work such as CRM enrichment, analytics queries, or a long sequence of third-party API calls.

3. A verified sending domain in Volanea

The from address in the Volanea request must use a domain you have verified. Authenticate the domain before testing the stream so a configuration problem does not become a confusing webhook failure. The Volanea API reference and setup guides cover sending, domain setup, and the API surface in one place.

Use a stable From address such as hello@updates.example.com or trials@example.com. The local part is a product decision; domain alignment and authentication are deliverability requirements.

4. A secret for Mixpanel-to-relay authentication

Create a separate random value for the inbound webhook, for example MIXPANEL_WEBHOOK_TOKEN. This is not your Volanea API key.

Configure Mixpanel’s Destination authentication with either an API key header or a bearer token. Your relay checks that secret before doing any processing. This prevents arbitrary callers from turning a publicly reachable webhook route into an email-sending endpoint.

Configure the Real-Time Event Stream in Mixpanel

The exact labels can evolve, but Mixpanel’s documented flow is: open Real-Time Event Streams, add a webhook Destination, select event types, optionally add property-level conditions, write a Liquid payload template, then save and enable the stream.

Set the destination URL to your relay endpoint:

https://app.example.com/webhooks/mixpanel/trial-started

For authentication, choose an API key header and use a private header such as:

X-Mixpanel-Webhook: your-long-random-inbound-token

That token belongs in Mixpanel’s server-side destination configuration and in your deployment’s secret manager. It is safe to give Mixpanel because it authenticates calls to your relay. It does not authorize email delivery by itself.

Then create a stream with:

  • Selected event type: Trial Started
  • Condition: plan equals pro
  • Optional condition: route only events where email is populated
  • Payload template: a compact JSON contract your relay understands

Send an intentionally small payload

Real-Time Event Streams support Liquid-templated payloads, so you control the JSON Mixpanel sends to your endpoint. Do not forward every event property by default. Analytics events can contain internal experiment names, device data, URLs, support notes, or identifiers that have no role in an email send.

Use a versioned, explicit contract. The fields below are an example payload produced by the stream for this Trial Started trigger:

{
  "event": "Trial Started",
  "distinct_id": "usr_8d271",
  "insert_id": "7fd65b75-6fc9-40d8-bdf2-144355fb2de9",
  "email": "ada@example.com",
  "first_name": "Ada",
  "plan": "pro",
  "trial_ends_at": "2026-10-23T00:00:00.000Z",
  "locale": "en",
  "schema_version": 1
}

The keys in this body are your relay contract, not a promise that every Mixpanel event naturally contains them. Your tracking implementation must actually provide email, first_name, plan, and trial_ends_at when it records Trial Started. The $insert_id value is particularly important: Mixpanel recommends including the event insert ID in the outbound payload when you need to deduplicate at-least-once deliveries.

Use the event-preview and template-validation tools in your Mixpanel stream setup to verify the rendered JSON against a real representative event. Pay close attention to quote escaping, absent values, and property names that include reserved characters. A template can be syntactically valid while still rendering an empty email address because the original event did not have the expected property.

Map the Mixpanel webhook into a Volanea email

The webhook handler below uses Node.js with Express-style request handling. It verifies the inbound Mixpanel secret, validates the payload, derives a stable idempotency key from Mixpanel’s insert_id, and sends an HTML email through Volanea.

The field mapping is explicit:

Mixpanel webhook fieldVolanea email fieldPurpose
emailtoIntended recipient
Static configurationfromVerified sender address
first_nameHTML contentPersonalization
planSubject and HTML contentMessage context
trial_ends_atHTML contentTrial deadline
insert_idIdempotency-KeyPrevent duplicate sends on retry
import express from "express";

const app = express();
app.use(express.json({ type: "application/json" }));

type MixpanelTrialStarted = {
  event: "Trial Started";
  distinct_id: string;
  insert_id: string;
  email: string;
  first_name?: string;
  plan: string;
  trial_ends_at: string;
  locale?: string;
  schema_version: number;
};

function escapeHtml(value: string): string {
  return value.replace(/[&<>'"]/g, (character) => ({
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    "'": "&#39;",
    "\"": "&quot;"
  })[character]!);
}

app.post("/webhooks/mixpanel/trial-started", async (req, res) => {
  // This authenticates Mixpanel to YOUR endpoint.
  // It is deliberately not the Volanea secret.
  if (req.get("X-Mixpanel-Webhook") !== process.env.MIXPANEL_WEBHOOK_TOKEN) {
    return res.status(401).json({ error: "unauthorized" });
  }

  const event = req.body as MixpanelTrialStarted;

  if (
    event?.event !== "Trial Started" ||
    typeof event.insert_id !== "string" ||
    typeof event.email !== "string" ||
    !event.email.includes("@") ||
    typeof event.plan !== "string" ||
    typeof event.trial_ends_at !== "string"
  ) {
    // A permanent payload/configuration error: do not ask Mixpanel to retry it.
    return res.status(400).json({ error: "invalid trial event payload" });
  }

  const recipientName = escapeHtml(event.first_name?.trim() || "there");
  const plan = escapeHtml(event.plan);
  const trialEndsAt = new Date(event.trial_ends_at);

  if (Number.isNaN(trialEndsAt.getTime())) {
    return res.status(400).json({ error: "invalid trial_ends_at" });
  }

  const formattedEndDate = new Intl.DateTimeFormat(event.locale || "en", {
    dateStyle: "long",
    timeZone: "UTC"
  }).format(trialEndsAt);

  const volaneaResponse = await fetch("https://api.volanea.com/v1/send", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.VOLANEA_API_KEY}`,
      "Content-Type": "application/json",
      // Reuse this exact key if Mixpanel retries the same event.
      "Idempotency-Key": `mixpanel-${event.insert_id}`
    },
    body: JSON.stringify({
      from: "Trials <trials@example.com>",
      to: event.email,
      subject: `Your ${event.plan} trial is ready`,
      html: `
        <h1>Welcome, ${recipientName}</h1>
        <p>Your <strong>${plan}</strong> trial is now active.</p>
        <p>Your trial ends on <strong>${escapeHtml(formattedEndDate)}</strong>.</p>
        <p><a href="https://app.example.com">Open your account</a></p>
      `
    })
  });

  const responseBody = await volaneaResponse.text();

  if (!volaneaResponse.ok) {
    // Return 5xx for temporary Volanea/network problems so Mixpanel can retry.
    // Return 4xx for permanent bad-request conditions after logging and triage.
    console.error("Volanea send failed", {
      status: volaneaResponse.status,
      body: responseBody,
      mixpanelInsertId: event.insert_id,
      distinctId: event.distinct_id
    });

    if (volaneaResponse.status >= 500) {
      return res.status(502).json({ error: "email provider temporarily unavailable" });
    }

    return res.status(400).json({ error: "email rejected" });
  }

  console.info("Trial email accepted", {
    mixpanelInsertId: event.insert_id,
    distinctId: event.distinct_id,
    volanea: responseBody
  });

  return res.status(202).json({ accepted: true });
});

Volanea’s send endpoint supports the Idempotency-Key header, which is what makes the Mixpanel retry behavior safe at the email API boundary. If Mixpanel delivers the same event again after a timeout or transient server failure, your relay uses the same event insert ID and the same idempotency key rather than creating a second logical email send.

Why escaping and validation matter

An email body is not a safe place to interpolate arbitrary analytics properties without controls. A first name such as <img src=x> should be rendered as text, not interpreted as HTML. Likewise, trial_ends_at should be parsed as a date rather than inserted blindly into an email.

Validation is also where you enforce your own messaging policy. For example, you might check that the user has a verified account, belongs to the correct workspace, has not opted out of promotional notices, or is eligible for a particular lifecycle message. Product analytics explains behavior; your application remains the source of truth for authorization and consent.

Keep the Volanea API key out of Mixpanel and the browser

The Volanea API key belongs only in your server runtime’s secret storage. In the example, it is read from process.env.VOLANEA_API_KEY, which should be provided by your cloud platform, secret manager, or encrypted deployment configuration.

It must not live in:

  • A Mixpanel payload template.
  • A Mixpanel event property.
  • Browser JavaScript or mobile-app configuration.
  • A public Git repository.
  • A query string.
  • A client-side environment variable that gets bundled into application code.

Mixpanel’s Destination authentication setting is for authenticating outbound requests from Mixpanel to your webhook. Put MIXPANEL_WEBHOOK_TOKEN there. Your webhook checks it, then independently uses VOLANEA_API_KEY to send email. These are different credentials with different blast radiuses.

If someone obtained the inbound Mixpanel token, they could attempt to call your relay; validation and rotation would limit the damage. If someone obtained your Volanea API key, they could potentially submit email sends as your account. That is why the Volanea key must never cross the server boundary.

Use separate keys and secrets for development, staging, and production. This avoids a staging event triggering a real production email and makes revocation less disruptive when a test environment is compromised.

When this breaks: retries, timeouts, and missing fields

Every webhook-to-email integration needs an intentional failure policy. The hard part is not sending a happy-path email; it is deciding what happens when a service sends the same request again, a response is lost, or the event does not contain the expected data.

Mixpanel retries can create duplicate sends

Mixpanel Real-Time Event Streams provide at-least-once delivery. Transient failures—including 5xx responses, timeouts, and network errors—can be retried up to four times with exponential backoff. A retry can occur even when your relay sent the email but failed before Mixpanel received the 2xx response.

Without a stable idempotency key, the sequence can look like this:

  1. Mixpanel POSTs Trial Started to your webhook.
  2. Your relay sends an email successfully.
  3. The relay crashes or the network drops before it returns a response.
  4. Mixpanel retries the same event.
  5. Your relay sends the welcome email a second time.

The fix is to map the same Mixpanel insert_id to the same Volanea Idempotency-Key. Do not create a fresh random UUID inside the webhook on every attempt. A new random UUID would make each retry look like a new email request.

For additional assurance, store an application-side delivery record keyed by insert_id, recipient, and message purpose. That protects you if your business logic changes, lets you audit a message later, and provides a place to record the Volanea message ID returned by the send response.

Webhook timeouts are not a reason to retry blindly

A timeout creates ambiguity: Mixpanel cannot know whether your endpoint did nothing, is still working, or completed successfully before the response was lost. Keep the webhook handler fast.

A robust approach is:

  1. Authenticate and validate the incoming event.
  2. Atomically store or enqueue work keyed by insert_id.
  3. Return a 2xx response.
  4. Let a worker perform the Volanea call with the same idempotency key.

For lower-volume transactional use cases, the synchronous example above can be acceptable if the Volanea call is fast and your platform has a sensible request timeout. For lifecycle sends at scale, queueing improves resilience, observability, and back-pressure handling.

Do not return 200 before you have made the operation durable. A premature success tells Mixpanel not to retry even if your process crashes immediately afterward.

Payload fields can be absent

Mixpanel only forwards what was captured on the event and what your template renders. A stream is not a magic profile-enrichment service. If email was missing when Trial Started was tracked, it may be absent or blank in the webhook payload. If your Mixpanel project does not have access to Real-Time Event Streams, you cannot rely on this direct outbound-event route at all.

Treat fields differently based on their role:

  • Required to send: insert_id, recipient email, event name.
  • Required for this message: plan, trial end timestamp.
  • Optional personalization: first name, locale, referral source.
  • Never trust without authorization checks: user IDs, organization IDs, entitlement data, consent flags.

For missing required fields, return a 4xx response after logging the configuration defect. Mixpanel treats 4xx responses as configuration errors rather than transient failures, so endlessly retrying a malformed event is not useful. For temporary downstream failures, return 5xx and let Mixpanel retry.

A 2xx acceptance is not the same as inbox placement

A successful Volanea API response means the platform accepted the request for processing. It does not guarantee that the recipient has received or opened the message. Suppression rules, unsubscribe status, mailbox-provider decisions, bounces, and complaints remain separate outcomes.

For production workflows, correlate three IDs in your logs:

  • Mixpanel insert_id
  • Your internal user or account ID
  • The Volanea email/message identifier returned by the send request

That correlation makes support tickets and delivery investigations far easier. You can answer whether an event was emitted, whether Mixpanel delivered it to the relay, whether the relay accepted it, and what happened after Volanea processed it.

Test the full path before enabling production traffic

A successful template preview is useful, but it is not the same as a successful end-to-end email. Test the actual pipeline with a controlled user and a mailbox you can inspect.

Use this checklist:

  1. Track one Trial Started event for a test user.
  2. Confirm the event appears in Mixpanel with email, $insert_id, plan, and trial_ends_at.
  3. Confirm your stream filter matches the event.
  4. Inspect the webhook request in your relay logs without recording unnecessary personal data.
  5. Verify your relay rejects an incorrect inbound token with 401.
  6. Verify the send request uses your verified Volanea From domain.
  7. Confirm one Volanea send is created.
  8. Replay the exact webhook payload and verify the idempotency key prevents a second send.
  9. Test a missing email field and confirm the route returns a clear 4xx response.
  10. Test a simulated Volanea 5xx response and confirm the route returns 5xx for retry behavior.

Test a payload with a quote, ampersand, and angle bracket in first_name as well. That confirms HTML escaping works and helps prevent an innocent personalization field from breaking your markup.

When to use a cohort sync instead

Real-Time Event Streams are the better pattern when one user action should cause an email soon afterward: trial activation, a completed application, a request for an export, an account notification, or a product milestone.

Cohort Sync custom webhooks serve a different purpose. Use a cohort when you want to maintain an audience based on behavior, such as people who used a feature three times in seven days or accounts that have become inactive. That is an audience-membership workflow, not an individual event-triggered message workflow.

For cohort-based email, your webhook should usually upsert audience state into your application or marketing workflow first. Do not automatically email every person every time a cohort export is refreshed unless you have designed frequency controls and entry/exit rules. Incremental audience membership changes can be useful triggers, but they need different idempotency keys and message logic than a single Trial Started event.

If your Mixpanel project does not have Real-Time Event Streams

Be direct about the limitation: without access to Mixpanel Real-Time Event Streams, Mixpanel does not provide this particular standard-plan, per-event outbound webhook path for a direct real-time Volanea send. Do not pretend there is a native Volanea destination or an “install integration” button.

Your alternatives are:

  • Request Real-Time Event Streams beta access from Mixpanel if real-time behavioral sending is a product requirement.
  • Trigger the email in your application at the source of truth. When your server starts a trial, it can call Volanea immediately and separately track the Mixpanel event.
  • Use an automation middleware such as Zapier or Make only if its available Mixpanel trigger and timing match your workflow. Keep the Volanea key in the middleware’s encrypted connection or, preferably, call your own relay endpoint so you retain validation and idempotency control.
  • Use Cohort Sync custom webhooks for audience-oriented workflows when a paid Mixpanel plan and cohort syncing are appropriate.

For truly transactional messages—password resets, receipts, security notices, access grants, or legal confirmations—trigger the email directly from the application transaction that created the state. Analytics should observe that action, not be the only system responsible for it.

Operational practices that protect deliverability

A behavioral trigger can be technically correct and still create a poor recipient experience. Before scaling this integration, define rules for cadence, consent, and relevance.

First, distinguish transactional email from campaign email. A trial-started welcome that confirms a requested trial is commonly transactional or service-related. A series promoting upgrades, referrals, or unrelated features may be marketing communication and can require different consent and unsubscribe treatment depending on where recipients are located and how the message is framed.

Second, avoid using the stream as a raw event-to-email engine. A person may trigger Feature Used twenty times in an hour. Your relay should have business rules such as “at most one onboarding nudge per user per seven days” or “do not send an upgrade email when an account already has an open support escalation.”

Third, monitor the quality of your trigger data. A rising rate of missing email fields, invalid dates, or rejected requests is often evidence that tracking changed before the email integration was updated. Treat the payload schema as a versioned contract and change it deliberately.

Finally, verify addresses when your workflow accepts addresses from forms, imports, or other untrusted sources. Volanea’s email address verification tool can help reduce obvious bad-address sends before they affect bounce rates and deliverability decisions.

Conclusion

To send email from Mixpanel with Volanea, use a selected Mixpanel event—such as Trial Started—as the trigger, deliver it through a Real-Time Event Stream to your own authenticated webhook, and make the Volanea API call from that server-side relay.

The relay is essential, not optional. It protects the Volanea API key, validates the event contract, escapes personalized content, applies consent and frequency policy, and converts Mixpanel’s at-least-once webhook delivery into one logical email send with Idempotency-Key: mixpanel-<insert_id>.

If Real-Time Event Streams are unavailable in your Mixpanel project, use an application-originated send or a carefully designed middleware route instead. The right implementation is the one that keeps email credentials private, sends only when the underlying business state is real, and remains correct when either side retries.

FAQ

Does Volanea have a native Mixpanel integration?

No. Volanea does not ship a native Mixpanel app, Marketplace listing, or one-click plugin. The integration uses Mixpanel’s outbound webhook capability plus your own server-side relay and the Volanea REST API.

What Mixpanel event should trigger the email?

Use a specific event representing a completed business action, such as Trial Started, Application Submitted, or Export Ready. Avoid high-frequency or pre-completion events such as page views and button clicks.

Why do I need the Mixpanel insert ID?

Mixpanel Real-Time Event Streams use at-least-once delivery and can retry transient failures. Include the event insert ID in the webhook payload and use it as the Volanea Idempotency-Key so retries do not create duplicate emails.

Can I put my Volanea API key in the Mixpanel webhook settings?

No. Store a separate inbound webhook secret in Mixpanel to authenticate calls to your relay. Keep the Volanea API key only in server-side secrets, where the relay can use it to call Volanea.

Can this send campaign email based on a Mixpanel cohort?

It can, but a cohort workflow should be designed differently from an event-triggered transactional email. Use Cohort Sync for audience membership changes and add frequency controls, consent checks, and entry/exit logic before sending a campaign message.