I have a product catalog and I want to programmatically access that catalog in my email templates. I am able to access a single catalog item using a syntax like:
{% catalog itemId %}
{{ catalog_item.title }}
{% endcatalog %}
However, I am not able to figure out how to perform advanced operations on catalog collection programmatically.
For example, I would like to find top 10 highest rated items from the catalog in a particular category and then randomly pick 3 items from that list and use those in an email template.
Any insights regarding this will be highly appreciated.