Handlebars: To Field Validation (VTEX Message Center)

Hey Devs! What’s up?

Inside VTEX Message Center I’m testing a validation on the To field in two templates.

The validation on the To field basically checks whether the purchase is a delivery order and, if so, outputs the email address so the template gets sent.

To Field Validation:

{{#eq shippingData.logisticsInfo.0.selectedDeliveryChannel “delivery”}}{{clientProfileData.email}}{{/eq}}

Validation Test Results:

Template 1: Order Invoiced
With this validation, the template doesn’t fire, whether the order is delivery or pickup-in-point.

Template 2: Order Shipped
With the same validation it works. I placed a delivery order and the email fired as expected, then I placed a pickup order and the email didn’t fire, also as expected.

The million-dollar question:

Why does the same logic work for Order Shipped but not for Order Invoiced?

Thanks in advance :slight_smile:

1 Like