Skip to main content

Sending emails based on number of products browsed or carted

Send emails only if a customer has browsed or carted a certain number of products using the Advanced option in a Trigger.

Updated over 2 weeks ago

Send emails based on product count

To send a trigger email only if the customer has carted or browsed a given number of products, use the following code in the Advanced box on the Triggers page:

result.proceed = true;

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

result.proceed = false;

}

Change 2 in the example above to the number of products required before the trigger is sent. In this example, if the customer has carted or browsed two or more products, the email will be sent.

Change the product count

Adjust the number 2 to fit your specific needs. For instance, if you want the email to be sent only when the customer has carted or browsed five or more products, change the code to:

result.proceed = true;

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

result.proceed = false;

}

Did this answer your question?