Display Conditions

Display conditions enable users to adjust the content presented to email recipients according to specified criteria.

Basic Use #

You can pass the appearance object during initialization like this:
mailui.init({ features: { displayCondition: { enabled: true, }, } });
mailui.init({ displayConditions: [ { label: "Men", description: "All man customers", key: "ismen", }, { label: "Women", description: "All women customers", key: "iswomen", }, { label: "Child", description: "All child customers", key: "ischild", }, ] });

Params #

Each display condition must contain the specified attributes.
PropertyRequiredDescriptionType
labelYesThis is the name of the condition that the user will see.string
descriptionno This is the description that the user will see for the condition.string
keyYesThe key is a unique value that defines each condition.string

Custom Condition Use #

You can pass the appearance object during initialization like this:
mailui.init({ displayConditions: [ { label: "Men", description: "All man customers", before: "{{#ismen}}", after: "{{/ismen}}", } ] });

Params #

Each display condition must contain the specified attributes.
PropertyRequiredDescriptionType
labelYesThis is the name of the condition that the user will see.string
descriptionno This is the description that the user will see for the condition.string
beforeYesThis is the opening syntax for the condition added before the selected element.string
afterYesThis is the closing syntax for the condition added before the selected element.string

Set Programmatically #

You can change appearance after initialization like this:
mailui.setDisplayConditions([ { label: "Men", description: "All man customers", before: "{{#ismen}}", after: "{{/ismen}}", }, { label: "Women", description: "All women customers", before: "{{#iswomen}}", after: "{{/iswomen}}", } ]);

Explore Our Email Builder