Solved

How to Change Subject line depending on how many products in card?

  • 5 April 2022
  • 7 replies
  • 225 views

Badge +2

if the item count is one, subject line should be: “You have an item in you shopping cart” 

if item count is more then one, subject line should be: “You have an items in you shopping cart” 

 

How do i did this?

Thanks! 

Alice 

icon

Best answer by Manny Singh 28 April 2022, 21:43

View original

7 replies

Userlevel 7
Badge +60

Hey @AliceC 

Thank you so much for asking such a great question! Happy to help.

You can use event variables in your subject line to customize how your customers are seeing it! This is unique to each ecommerce platform and each account as to the event information being used it’s hard to tell you exactly what to use for syntax but an example for BigCommerce would be: {{ event.extra.line_items.0.quantity }} . The article I included goes over how to use and find the correct event variables you are looking for to use in your subject lines!

Hope this helps!

Badge +2

Thanks @stephen.trumble ! 

We use Shopify. Could you help me string the subject line together with the event variable in an IF statement?  

if the item count is one, subject line should be: “You have an item in you shopping cart” 

if item count is more then one, subject line should be: “You have an items in you shopping cart” 

Badge +2

For instance would it be this…?

 

{{ % if event.extra.line_items.0.quantity = 1 %}} You have an item in you shopping cart {% else %} You have items in you shopping cart {% endif %}

 

OR 

 

{% if items.quantity|floatformat:0 < 2 %} You have an item in you rshopping cart {% else %}You have items in your shopping cart {% endif %}

 

Sorry i’m only a novice. Any help would be greatly appreciated! 

Userlevel 7
Badge +38

I believe it would be like the first example you gave.  What happens you test it out with Preview? 

Userlevel 3
Badge +1

Waiting for preview results

Userlevel 7
Badge +60

@Mailbox Manny is most likely correct, the first example you you shared {{ % if event.extra.line_items.0.quantity = 1 %}} You have an item in you shopping cart {% else %} You have items in you shopping cart {% endif %}. Definitely preview the email to make sure it is correct. 

Thank you all for working together to find a solution and for being part of the Klaviyo Community!

Badge +2

@ayyub_here @Mailbox Manny 

No - “{{ % if event.extra.line_items.0.quantity = 1 %}} You have an item in you shopping cart {% else %} You have items in you shopping cart {% endif %}”  does not work hence i’m asking the question. 

Any one have any ideas?? 

 

Reply