Skip to main content
Solved

How to reference Transaction Email API message_data in liquid?


I’m trying to use this endpoint to send transactional emails to end users. 

Each email has the following unique metadata:

  • URL
  • String

The documentation linked above mentions using message_data → liquid_data in order to pass data through to the template. 

But I can’t figure out how to reference the message_data object using liquid from the template edit screen. 

How do I reference the message_data field from the API in the template?

Best answer by katie_judd

Howdy! Popping in as a Customer.io Technical Support Engineer to say Felix is right on the money. To reference data within a transactional message, it will need to be formatted as trigger.attribute.property 

Resource: https://customer.io/docs/transactional-api/#trigger-data-and-content-variables

View original
Did this topic help you find an answer to your question?

3 replies

Felix
  • Novice
  • 210 replies
  • March 15, 2023

Hey Matrix,

I am not a developer, so this might no be useful (or too obvious for a solution 😀)  but have you tried this:

{{ trigger.message_data.url }}

 

What excatly have you tried already?

Felix


  • 14 replies
  • Answer
  • March 15, 2023

Howdy! Popping in as a Customer.io Technical Support Engineer to say Felix is right on the money. To reference data within a transactional message, it will need to be formatted as trigger.attribute.property 

Resource: https://customer.io/docs/transactional-api/#trigger-data-and-content-variables


  • 1 reply
  • October 5, 2023

For anyone who comes across this problem, you actually just need to access the properties on “trigger”. e.g. 

{{ trigger.url }}


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings