Skip to main content
Solved

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


Forum|alt.badge.img+3

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 

Best answer by Manny Singh

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

View original
Did this topic or the replies in the thread help you find an answer to your question?

7 replies

stephen.trumble
Community Manager
Forum|alt.badge.img+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!


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 9 replies
  • April 20, 2022

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” 


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 9 replies
  • April 20, 2022

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! 


Mailbox Manny
Partner - Silver
Forum|alt.badge.img+38
  • Partner - Silver
  • 417 replies
  • Answer
  • April 28, 2022

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


Forum|alt.badge.img+2
  • Problem Solver II
  • 34 replies
  • May 2, 2022

Waiting for preview results


stephen.trumble
Community Manager
Forum|alt.badge.img+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!


Forum|alt.badge.img+3
  • Author
  • Contributor IV
  • 9 replies
  • May 3, 2022

@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