I would like to send an Email everytime a shipping status is updated (out_for_delivery, delivered), but when there is 2 shippings of a same product (so 2 fulfillments) in the mail It is written “The last items in your order have been delivered” but there is still 1 to deliver so I would like to know if there is a way to know how many of a product has been already delivered (a Liquid variable that I didn’t see maybe) so I can send “some” or “one” instead of “the last”
{% if fulfillment.item_count == item_count %}
{% capture email_title %}Your order has been delivered{% endcapture %}
{% capture email_body %}Your order has been delivered. Track your shipment to see the delivery status.{% endcapture %}
{% elsif fulfillment.item_count > 1 %}
{% if fulfillment_status == 'fulfilled' %}
{% capture email_title %}The last items in your order have been delivered{% endcapture %}
{% capture email_body %}The last items in your order have been delivered. Track your shipment to see the delivery status.{% endcapture %}
{% else %}
{% capture email_title %}Some items in your order have been delivered{% endcapture %}
{% capture email_body %}Some items in your order have been delivered. Track your shipment to see the delivery status.{% endcapture %}
{% endif %}
{% else %}
{% if fulfillment_status == 'fulfilled' %}
{% capture email_title %}The last item in your order has been delivered{% endcapture %}
{% capture email_body %}The last item in your order has been delivered. Track your shipment to see the delivery status.{% endcapture %}
{% else %}
{% capture email_title %}One item in your order has been delivered{% endcapture %}
{% capture email_body %}One item in your order has been delivered. Track your shipment to see the delivery status.{% endcapture %}
{% endif %}
{% endif %}
imagine an order with 2 products (A, B) and the client orders 2 of each (products ordered: A,A,B,B), I will fulfill it as [A,B] and [A,B] (I can have sometimes multiple packages like that), let’s call them p1 and p2, when p1 is fulfilled in the email there will be written “some items” and when p2 will be fulfilled it’s “the last items”, normal until here, but then in the email for “out_for_delivery” status there will be written “the last” even if it is p1 being “out_for_delivery” and not p2, so I want to know when is a package is delivered so I can chose between “the last items” and “some items”
This looks like an interesting problem to solve. However this will take some more investigation to provide a solution. We can investigate and implement for you next week if you would like. Contact me via shule@firstlight.dev.