Jinja

Using the Jinja Templating Language

Send highly personalized emails to your customers with personalized elements such as customer attributes (name, email address) or product attributes (product category, name). Bluecore personalizes emails with Jinja templating language to add additional customization to content.

Bluecore supports everything that's available in the Jinja templating language. We’ve also added additional custom filtering for particular use cases.

Please note that this is an advanced article requiring a technical skill set. For a more basic understanding of dynamic attributes in Bluecore, click here.

Looking for examples of how to use Jinja in subject lines? Check out this article for some of our suggested use cases.

Getting started

Before adding customer attributes to your email campaigns, be sure to review the data that’s available within your account through the Customer 360 page. You can see the product attributes available within your account through the Product Catalog page. If there is a specific attribute you’d like to use, such as customer first name, last name; please be sure this is included in your Bluecore integration.

Learn more about how to use Jinja in tracking parameters here.

Using invalid Jinja in email templates can cause the template to not render in the summary tab of email campaign building. When adding Jinja to your templates, make sure the template correctly renders before setting the campaign live. If the template preview is not rendering in the campaign summary page, link tracking will not function. Even if proofs render and the campaign sends as expected, link tracking is tied to the template preview. For the entire time the template is invalid, link tracking will be blocked and unrecoverable.

Customer attributes


Campaign attributes


Dynamic product attributes

For the following attributes, be sure to adjust the below templated Jinja syntax to match the blocks, products, etc. within your email. For example, the dynamic attribute of #{{BLOCKNAME.products.0.url}}, the BLOCKNAME should be replaced with the actual name of the block in the email.

The below attributes can be configured to display the most common value (mode) of the products or the value of the first product.

This is only a sampling of the attributes that are available for your account. Please see the Product Details Page within your account for the full list.


Price attributes 

We recommend using the Dynamic Product Blocks in VTE. If you must use an advanced custom code block to display product information, you can use this syntax.


Advanced Jinja filters

Jinja Templating Language Examples

The below Jinja subject line examples are only examples from Bluecore campaign types. Please be sure to modify the below Jinja syntax before adding them to an email campaign.

Each example of Jinja requires a specific set of data that must be available within Bluecore. You can see available data in your account through the Customer 360 and Product Catalog pages. Please be sure the appropriate data is being passed to Bluecore for the Jinja examples to properly display in emails.

Abandoned cart

  • Re : #{{BLOCKNAME.products.0.name}} #{{BLOCKNAME.products.0.brand}}
  • Your #{{BLOCKNAME.products.0.name|title }} Is Waiting For You
  • {% if customer.first_name %}#{{customer.first_name}}, {% endif %}You Left Items in Your Cart

Abandoned product

  • Your #{{BLOCKNAME.products.0.name}} is waiting!
  • We like #{{BLOCKNAME.products.0.category|replace(':','') }}, too!
  • You know what would go great with #{{BLOCKNAME.products.0.category|replace(':','') }}?

Abandoned search 

  • {% if customer.first_name %}#{{customer.first_name}}{% else %}Hey{% endif %}, you searched, we found πŸ‘
  • Did you forget your #{{ BLOCKNAME.products.0.name }}?
  • Don't Forget About #{{BLOCKNAME.products.0.brand}}

New arrivals

  • Have You Seen What’s New From #{{BLOCKNAME.products|mode('brand') }}?

Window shopping

  • Your #{{BLOCKNAME.products.0.name}} is waiting!
  • Our Best Selling #{{BLOCKNAME.products.0.category}}

Price decrease

  • Good news! Our #{{BLOCKNAME.products.0.name}} has a new, lower price.
  • Price drop on #{{BLOCKNAME.products.0.name}}
  • Price Drop Alert: The #{{BLOCKNAME.products.0.name}} has a new, lower price.

Low inventory

  • Better Hurry! The $#{{BLOCKNAME.products.0.price}} #{{block_0.products.0.name}} Is Going FAST
  • {% if customer.first_name %}#{{customer.FIRST_NAME|title}}, c{% else %}C{% endif %}atch your faves!
  • #{{BLOCKNAME.products.0.name}} is Almost Out of Stock

Best sellers

  • #{{BLOCKNAME.products.0.name|title}} & Best Sellers Picked for You!

Setting a fallback

Including fallback language ensures that each customer will still receive something in the place of the dynamic attribute. If Bluecore is unable to pull in the specific customer attribute, the email will still go out with the fallback in place.

Example fallback: {% if customer.first_name %}Dear #{{customer.FIRST_NAME|title}}, {% else %}Dear Customer,{% endif %} catch your faves!

Testing

Be sure to test the email before sending. Review the code, test, and preview the email before hitting Save & Launch! Click here for more information on testing dynamic attributes before sending an email.