Skip to main content
All CollectionsTriggersAdvanced trigger control
Send emails only if a customer has browsed or carted a certain number of products
Send emails only if a customer has browsed or carted a certain number of products

Using the Advanced option in a Trigger, you can add JavaScript to control whether a Trigger is sent.

Updated over 6 months ago

To only send a trigger if the customer has carted or browsed a β€” based on the trigger you add it to β€” a given number of products, use the following code:

result.proceed = true;

if ( helpers.getProducts().length < 2 ) {

result.proceed = false;

}

Change 2 in the example above to alter the number of products before it triggers. In this example case, two or more products would mean the email is sent.

Did this answer your question?