Flow internal email containing only the relevant line items

enthousiaste
Tourist
5 0 8

I have a flow which goes like this Product> Trigger: New Order > Check if: the order includes items from a certain vendor > Action: Send internal email to relevant category manager with a copy of all line items in the order. However, is it possible to only include on the internal email the line items that are relevant to that category manager? For example, it would be great if any new orders containing items with the vendor 'produce' items to trigger an internal email to the produce team which lists all produce items in the order, preferably leaving all other non-produce items off this email?

Reply 1 (1)

jennywills
Shopify Staff
9 4 1

Yes this should be possible using liquid when looping over the line items in the send email action. It would look something like:

{% for lineItems_item in order.lineItems %}
  {% if lineItems_item.product.vendor == "some vendor" %}
   [the liquid for adding the details for the lineitem]
  {% endif %}
{% endfor %}

To learn more visit the Shopify Help Center or the Community Blog.