Filter Previously Recommended Content

Use the Advanced tab in an HTML template to filter content previously recommended for a user.

  1. Create a new HTML template or open an existing one. 
  2. In the Advanced tab, locate the Setup textbox. 
  3. Filter out previously recommended content items using the content function.
    {content = filter(content, lambda x: !contains(profile.vars.previous_recs, x.url))}

    Place the function at the top of the Setup box.

  4. Use the append_user_var function at the bottom of the Setup box to add content from the current send to the same vars on the user profile. This allows you to filter the current content in future sends.
    {foreach content as c}</span>
    {append_user_var('previous_recs', c.url)}
  5. If you wish to send a specific number of articles, for example 5, use the slice function to only add those five articles to the user profile.
    {content=slice(content, 0, 5)}
    {foreach content as c}
    {append_user_var('previous_recs', c.url)}