Skip to main content

I want to sent out an email to a specific list via the API, using a template. This is already working, but:
My templates has variables such as {{ intro_text }}, {{ offer_title }} etc.. Where do i supply this data? I cant find any information in the docs, and i tried adding it to attributes to both the campaign and the campaign-message. What am i missing?


Here is my api call as of now:

I created a campaign, and included the list id in audiences.
I have assigned a template via the /campaign-message-assign-template endpoint

I send out the campaign with the /campaign-send-jobs endpoint

​​​​​​​

Can you help?

Best regards,

Lars

Hi ​@larsu,

The variables {{ intro_text }} and {{ offer_title }} don’t appear to be Klaviyo variables, so our templates won’t display them. If you were to use a variable like {{ person.email }}, you’d see the profile property populate in the template. 

Let me know if I’m missing something. Also, a screenshot of the API call would be helpful as well! Thanks.


That is my question, how do i supply custom template variables when sending out a campaign with a template?


Thanks for confirming. Unfortunately, at this time, Klaviyo templates only support Klaviyo variables, and not custom template variables that would work for templates outside of Klaviyo. You can take a look at our message personalization reference article here, which goes into more detail on the type of variables that Klaviyo supports.