Send Email From Mixpanel

Mixpanel allows you to tie data to a specific user, creating a profile. This is where you store things like their email address, where they came from, or their age. When you include an email address, you can start sending targeted emails right from Mixpanel. At this time, Mixpanel users on a free account are limited to 150,000 email messages per month. Read more about message limits.

Email targeting can be based on properties in user profiles, or events that did or did not occur within the last 90 days. For example, if you set a Signup date property, you can create an email that only sends to users who signed up over two weeks ago.

Sending Email Addresses to Mixpanel

You can only send emails to users whose profiles have the special $email property. The value of this property should be the email address of the user as a string - something like "joe.doe@example.com". To set this property with the JavaScript library, you can make a call to mixpanel.people.set:

mixpanel.people.set({
    $email: "joe.doe@example.com"
});

Creating an Email Message

An email message consists of a from-name and address, a subject, and a message body. To create a new email message, navigate to the Messages report and select Email Message from the "Create new message" dropdown. This will give you the following form:

Screen_Shot_2019-09-10_at_10.07.09_AM.png

It's important to note that you can use profile properties in all of the email fields.

Click on a template of your choice to enter the drag-and-drop email builder. You can switch back to the classic builder at any time by clicking Switch to Classic Editor.

Save a draft of your message at any time in this process by clicking the Save button at the top of the page.

Screen_Shot_2019-09-10_at_11.18.24_AM.png

You can view all of your saved drafts by clicking on the Drafts tab of the main Messages page.

Screen_Shot_2019-03-20_at_12.59.26_PM.png

Using Profile Properties in Emails

Our templates will replace content that is wrapped in {{}}. For example, if you add a Location property to your user profiles, you can send messages like this:

Come and visit us at our {{ ${Location} }} office!

A user with a profile property Location: Asheville will get the following message:

Come and visit us at our Asheville office!

If some of your profiles have a value but others don't, you can use a fallback value:

Come and visit us at our {{ ${Location} | fallback:"nearest" }} office!

Profiles without a Location property will receive this message:

Come and visit us at our nearest office!

Using Conditional Logic in Emails

When a fallback value for a missing people property is not enough, you can also use conditional blocks to change the contents of your message. Mixpanel treats the tags {% and %} as conditional logic, meaning you can use these tags to create a conditional email message.

There are three tags which will always appear in a conditional block in the same order:

  • The if tag (explained below)
  • The else tag (which is always written {% else %})
  • The endif tag (which is always written {% endif %})

The {% if ... %} tag is the most important as this determines the conditional logic. It consists of:

  • An opening {% and the word if
  • A property name, surrounded by ${ and } (just like in a variable)
  • A closing %}

If the property name after the "if" is defined for a particular profile (meaning it isn't a boolean false value, an empty string, or a zero), then the text between the if block and {% else %} will appear in the email sent to that profile. Otherwise, the part between the {% else %} and the {% endif %} is included. In our Location case, we might use a conditional block like this:

{% if ${Office Location} %}

Come and visit us at our {{ ${Office Location} }} office.

{% else %}

You haven't told us your location. Please update your location in your account, and we'll send you to our nearest office.

{% endif %}

A user with a profile property Location: Asheville will get the following message:

Come and visit us at our Asheville office.

On the other hand, profiles without a Location property will receive this message:

You haven't told us your location. Please update your location in your account, and we'll send you to our nearest office.

Targeting Users

After submitting the form for your message design and content, you will then need to define the targeting criteria for the users who will receive the message.

A message's targeting criteria can contain one or more filters. Each filter can contain one or more conditions.

First, select an event, people property, or cohort from the first drop-down list.

Screen_Shot_2019-09-10_at_11.11.03_AM.png

You can add as many of these targeting filters as you like, which creates groups to target. Add more filters by clicking the + button.

You can then select whether you want to target customers that match all or only some of the filters you chose.

MessagesGroupUngroup.gif

Filtering by Events

If you select an event, you will be able to choose when or how frequently that event was performed or not performed by the users you are targeting.

MessagesTargetEvent.gif

You can filter deeper by event or people property by clicking the + Filter button.

You can also choose to add conditions to this targeting event by clicking the + Condition button in the top right of the group. This will serve as a second event target.

MessagesTargetEventCondition.png

You can then select whether you want your targeting users to do both the targeting event and the condition, either or, or to perform the targeting event and then the condition.

MessagesTargetConditionOrAndAll.png

Filtering by Property

If you select a people property, you will be able to choose the specifics of that property depending on the property type (date, string, list, etc.). For example, “First App Open” is a date property, so you will be able to choose when “First App Open” occurred.

MessagesTargetProperty.gif

You can select people property filters by clicking the + Filter button.

You can also choose to add one or more conditions to the property filter by clicking the + Condition button at the top right of the group. This will serve as a second property filter.

MessagesTargetPropertyCondition.png

You can then select whether you want your targeted users to have both the targeting property and the condition, or one or the other.

Filtering by Cohort

If you select a cohort, you will be able to select whether you want to target users in or not in the cohort.

MessagesTargetCohort.gif

You can select people property filters for that cohort by clicking the + Filter button.

Scheduling Your Emails

Once you've targeted your users, you just have to schedule the email. There are two options for scheduling emails:

  • ASAP messages: These messages go out to individual users as soon as they match the targeting criteria. It's common for users to go from "not matching" to "matching" - many messages include a time-based requirement such as "last login was greater than two weeks ago", or one based off of other profile properties that may change.

    Screen_Shot_2019-09-10_at_10.09.19_AM.png

  • Scheduled messages: These messages can be set to go out at a specified time, day of week, and interval. For example, you could set your message to go out at 9am PST every Wednesday. When the message runs, it finds all the users who match the criteria you have defined and sends it to them.

    Screen_Shot_2019-09-10_at_10.14.05_AM.png
Is this article helpful?
12 out of 30 found this helpful

Comments

0 comments

Article is closed for comments.