Using IF statement in SMS template

Highlighted
New Member
1 0 0

Hi all

 

I'm trying to add IF statements into the SMS template to match the email template. The statements I'm using work fine in the email, but always defaults to the ELSE in the SMS

 

Does anyone know why this might me? It's driving me nuts! Thanks

 

Hi {{ customer.first_name }}, {% if attributes.Checkout-Method == "pickup" %}your order is ready for collection.{%- elsif attributes.Checkout-Method == "delivery" -%}your order has been picked, is currently being loaded into our van and will be with you shortly.{%- else -%}your order has been shipped!{%- endif -%}

 

0 Likes
Highlighted
Shopify Partner
51 3 9

I am assuming you are getting the attributes from the Order object? Has that been defined anywhere? Try this:

 

 

Hi {{ customer.first_name }}, {% if order.attributes.Checkout-Method == "pickup" %}your order is ready for collection.{%- elsif order.attributes.Checkout-Method == "delivery" -%}your order has been picked, is currently being loaded into our van and will be with you shortly.{%- else -%}your order has been shipped!{%- endif -%}
Copy

 

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
0 Likes