Introduction
Welcome to this tutorial! In this guide, we'll be discussing how you can efficiently pull an attribute from a person's company into an email for a newsletter distribution using Liquid. Let's get started!
Problem
The challenge encountered in this situation is pulling a specific attribute from an object 'company' to be used in a newsletter. Understanding how to reference the attribute using Liquid might be tricky.
Solution
The solution is quite straightforward; all we need to do is reference the attribute from the object (companies) using Liquid in the same way that you would typically reference profile attributes.
Essentially, there's a clear difference in referencing objects compared to profile attributes. Whilst both offer great functionality, their application is subtly different.
You’ll reference objects in liquid by their type. By default, this means you’d use {{objects.companies}}
. Or, if your objects were called Online Classes, you’d use {{objects.online_classes}}
.
In contrast, when referencing profile data you’d use {{customer.companies}}
or {{customer.online_classes}}
.
We’ve provided some examples to help you take advantage of objects being referenced using liquid.
Resources
If you're interested in finding out more or want more practical examples, please do visit the following link: Customer.io Liquid Documentation