Solved

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

  • 5 April 2022
  • 7 replies
  • 70 views

Badge +1

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 6
Badge +50

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 +1

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 +1

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 6
Badge +32

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

Userlevel 3
Badge

Waiting for preview results

Userlevel 6
Badge +50

@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 +1

@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