Community Tip: Mixpanel Email Notifications - Mixpanel
Blog Post

Community Tip: Mixpanel Email Notifications

This Community Tip will explain how People Properties can be used within an email message to customize both the content and presentation. Use these tricks to add personalization and drive deeper creativity in your marketing or lifecycle emails.

Mixpanel’s Notifications are specifically designed to give you a tool to engage with your users, and keep them coming back. A great way to ensure your users connect to the content is to tailor the notification, and message itself, with information useful to the person, and what he/she may need at a given point in the lifecycle of the product/service.

To illustrate this, let’s imagine the following scenario: I have a mobile game, where you, an up-and-coming space cadet, are tasked with the quite unique and innovative concept of defending the earth against gnarly aliens!

I want to set up a notification campaign that looks for people that have played the game, but who have not returned in a while, and try to get them to get back and do their duty! This is an example of the type of user we want to target:

People Properties

Based on the information we have, I want to target based on a couple of things:

  • Since we have a property with the date the last game was played, we can use this to target people who have not played one in 7 days.
  • I don’t want to send this to new users (they already have recent onboarding communications). Luckily, besides dates, we have a “Progress” property on the profiles, which relates to a percentage of the game that has been completed so far, so we can target users who have completed at least 75% of the game (as an example).

With the plan in mind, it’s on to the message. Here we can see the email being built:

Building the message

In green you will see aspects that are meant to give the message a personalized touch, by mentioning the user’s name, and including the avatar on the profile. When including people properties in a message, the syntax is: open double brackets “{{“, followed by a space ” “, followed by a dollar sign “$”, the name of the property in between brackets "{property name}", another space ” “, and finally, closing double brackets “}}”.

The first name goes in plain text, so we just add it like this {{ ${$first_name} }}

The wonderful thing is that properties are also available in the HTML, so we can do:
<img src="{{ ${Avatar} }}" />

To create an image tag with the URL pointing to the avatar!

Now that we named the user by name, let’s get the cadet engaged. Showing the progress in the game could be a way to motivate to go on! But how do we make a bar show a percentage? In this case, I chose to create a table with a grey background, which is 100px wide, and the cell within only as wide as the percentage the user has completed, creating the illusion of it being filled.

<table width="100" height="10" cellpadding="0" cellspacing="0" border="0" bgcolor="#DDDDDD">
<td width="{{ ${Progress} }}" style="background-color:#FF8719"></td>
<td> </td>

Do remember that the HTML can be accessed by toggling the Visual/HTML buttons in the email editor.

For the “piece de resistance”, I want to point out how we can make great use of conditional statements.


If you take a look at the links I provided in the message, you will see that we use the {% if ${property} %} syntax, to evaluate whether a property has been defined, and whether it evaluates to true. I’d like to take advantage of this to provide users with the information they need. As an example, in Funnels, I see that people who have upgraded their cannons, tend to complete the game more than those who don’t, so if the user has not done so, I’d like to provide a link on a topic related to it, but if he/she has, I don’t want to send useless information, so I add a different tip. Alright, perhaps it’s not useless, but it’s information no longer relevant to the user, and we want to make each line count.

In our docs, you can see more specific information on how these conditional statements can be built through this doc

With all of this in place, we schedule the notification, and here is the final product:

Final product

And, just as a recap, here is everything we customized using People Properties:

Final product

Fun, right? This goes to show that there’s more than one way to use the tools we have!

Any questions? Email us at to speak with someone smart, quickly.

Get the latest from Mixpanel
This field is required.