Skip to main content
One handy use for a computed field is working out which product a customer views or buys most. Here’s how to show that product in a campaign with template engine parameters.

The task

Send customers the products they view most, plus a set of similar products to help them make up their mind.

How to build the parameter

  1. To reach the customer profile, start with the base Recipient parameter.
  2. Open the list of custom and computed fields with the CustomField parameter.
  3. Pick the computed field you need. You get a parameter like Recipient.CustomField.<Computed field>.
Every product field is available to output. To pick recommendations, use the Recommendations parameter to open the list of recommendation presets available for a product, and pick the one you need. You get a parameter like Recipient.CustomField.<Computed field>.Recommendations.<Preset>.Take(<Number of collection items>). Every field of the recommended products is available to output. The parameter you’ve built is a collection, so to reach the products in it, use a for...end for loop.

Markup example

Let’s show the product’s name, description, price, and image in the campaign. Simplified markup:
With a table layout for the recommendations:
The customer gets an email with their most-viewed product and four similar products below it.
In the Maestra Editor, you can show a product from a computed field without any parameters or code. See How to show a product from a computed field in the Maestra Editor.