User Attributes

You can make your marketing messages more conversational by referring to relevant user attributes, ranging from basic ones like the first name of a user, to more advanced attributes relating to the user’s activity or selections. Blueshift’s dynamic template language enables you to leverage user attributes in creative ways.

You may refer to user, custom CRM attributes and product attributes in your template. The format is {{variable_name}}.


You may refer to user, custom CRM attributes and product attributes in your template. The format is {{variable_name}}.

Standard user attributes

  • user.firstname
  • user.lastname

Custom user attributes

You can refer to custom user attributes that you have sent via the ‘identify’ events or through CRM attribute upload. The format is{{user.extended_attributes.variable_name}}.


  • unsubscribe_link – Custom unsubscribe tracking link
  • email_preview_link – Link to show a web-based preview link with tracking

You can add any of these user attributes to your HTML output by referring to them as {{ variable_name }}


Hello {{user.firstname}}


Blueshift uses the Liquid template language to allow you to add custom user/product/CRM attributes, as well as dynamic elements in your email templates.

You can add simple filters that modify your variables. Filters are pre-defined functions that allow you to make some customizations easily.


Hello {{ user.firstname | upcase }}

Default filters:

  • date – reformat a date (syntax reference)
  • capitalize – capitalize words in the input sentence
  • downcase – convert an input string to lowercase
  • upcase – convert an input string to uppercase
  • first – get the first element of the passed in array
  • last – get the last element of the passed in array


You can add logic blocks to your templates using:

  • assign – Assigns some value to a variable
  • capture – Block tag that captures text into a variable
  • case – Block tag, its the standard case…when block
  • comment – Block tag, comments out the text in the block
  • cycle – Cycle is usually used within a loop to alternate between values, like colors or DOM classes.
  • for – For loop
  • break – Exits a for loop
  • continue Skips the remaining code in the current for loop and continues with the next loop
  • if – Standard if/else block
  • include – Includes another template; useful for partials
  • raw – temporarily disable tag processing to avoid syntax conflicts.
  • unless – Mirror of if statement


You can add a conditional salutation block if the user’s firstname is given:

{% if user.firstname != null && user.firstname != "" %}
  Hello {{ user.firstname }},
{% endif %}

You can do numeric comparisons and show conditional messages in your template, by:

{% if user.age > 18 %}
   Login here
{% else %}
   Parental consent required.
{% endif %}


You may read up more on Liquid here.