Solved

Can I use a dynamic event name in a subject line?

  • 24 January 2022
  • 5 replies
  • 161 views

Userlevel 1
Badge

Hey Klaviyos!

 

New here, and was wondering if anyone knew the answer:

I’m building a price drop flow, and wanted to know if it works to insert the dynamic price drop event code in the subject of the email line - like this Price Drop Alert: {{ event.price_drop_percent }}% off!

Thanks in advance!

 

Daniel

icon

Best answer by retention 24 January 2022, 19:55

View original

5 replies

Userlevel 7
Badge +35

Hi @Daniel F13 - it should work!  All Profiles properties (and Custom Properties) as well as the Event properties for a recipient that works in your Template should also work in the Subject and Preview Text. 

You can test this by sending yourself a Preview email and selecting a real event to test just to be sure.

 

Userlevel 1
Badge

Awesome! Thank you, @retention! It’s a little hard to test, only because it’s a price drop trigger and that event has not occurred yet, but your info is good to know! TYSM!

Userlevel 1
Badge

@retention thanks again - quick question, in the body of the price drop email, I’m trying to use dynamic event tags, like this:

Save ${{ event.price_drop_amount }}! Your {{ event.product_name }} was ${{ event.original_price }} and today it's ${{ event.reduced_price }}!

 

but it seems that only the reduced price one is populating - as is evident from the faint white box around it and the truncated text in the attached screenshot.

I don’t have any data to populate email preview with, but wondering if the other tags will eventually populate like the reduced price one is now.

Thanks again.

 

  • Daniel
Userlevel 7
Badge +35

@Daniel F13 - It should work, but make sure you’re adding those variables “cleanly” - the best way to do this is in the “source” of the text block.  Sometimes when you add variables in the text editor, it will add the HTML version of those brackets because it misinterpreted that you wanted to literally show the brackets and not a Template variable.

To edit the “source” of a text block, click on the “Source” icon in the text editor and add in the variable where it should be.

Here’s how to edit the “source” on the legacy editor:

… and on the new Template editor:

See if that fixes your issue and let us know!

Userlevel 1
Badge

Wow! @retention thanks for going the extra mile to answer my question. Sorry I didn’t respond till now, but somehow I missed your reply.

In the meantime, someone told me that my issue was that I had not added the  | floatformat:2 to the code, which is why it was not displaying properly.

But what you wrote here is really helpful.

 

Thanks again!

 

Daniel

Reply