Email preview doesn't generate correctly

If you're encountering an error with Email Preview Functionality, there are two solutions you can implement.

Leanplum's email functionality references user attributes to send and preview your email to the right recipient. Typically, the user attribute is "first_name" and "unsubscribe_token." If your test device is missing either of those fields, then the email can't be generated.

There are two solutions:

Solution 1: Modify Email Templates

Modify your email templates to include a default value if first_name and/or unsubscribe_token are missing. This ensures that a value is included regardless and the email can properly send.

Example:
Instead of using the following: {{"first_name" value}}

Use this as an alternative to place a default value: {{ userAttribute.first_name | default('there') }}

Check out our Leanplum templating language guide for more alternatives. Doing this will ensure that the email will be generated and sent to all users, even those who are missing those user attributes.

Solution 2: Modify Test Device or Select New Device

You can modify your test device (by clicking on Test Devices from the dashboard) to ensure that your profile has the required user attributes.

Remove the current test device and select one of your user accounts in your database (see Audiences), and register the user with existing user attributes as your test device.