Skip to main content
Use this approach whenever you need to limit the products in a campaign to the value of a customer’s computed field, matched against a product custom field — in other words, show only products with the trait the customer prefers. You can build product sets by favorite color, vacation destination, book genre, and so on. Here’s how it works, using clothing size as the example.

The task

A computed field tells you which size each customer buys most. You want to send them a set of new arrivals and show only products in their size. To do that, build the campaign markup with template engine parameters.

How it works

  • Your account has a computed field that works out which size (a custom field on the product) the customer buys most often, and writes the value to their profile. For example, a customer who mostly buys size M gets M.
  • A template engine function lets you pick, from any product segment, only the products with the right value for each customer. If a product’s size matches the customer’s computed value, it can show in the campaign.

How to build the parameter

  1. To reach the list of all unique products, use the base Products parameter.
  2. Pick a product segment with the GetBySegment() function.
  3. Filter the set by the customer’s computed field with the FilterByRecipientCustomField() function.
  4. Set extra filtering and sorting:
You can output any product field from the collection you’ve built.

Markup example

Let’s show each product’s name, image, price, and size in the campaign:
The customer gets an email with four new arrivals, all in their size.