1. Home
  2. Docs
  3. Personalization
  4. Introduction
  5. About Advanced Personalization

About Advanced Personalization

FeedBlitz’s templating language is designed to be accessible by a wide variety of tech resources. Whether you’re a DB developer used to writing SQL, a C++ coder, or a front end desighner, you should find building hyper-personalized email templates with FeedBlitz easy to get to grips with.

That’s because a design goal of FeedBlitz’s template customization syntax has been, and continues to be, to enable you to build customizations using code in FeedBlitz similar to the syntactical style with which you’re most comfortable.

So, for example, the following statements are equivalent for a logical equality test:

  • 1=1 (SQL style comparison, and also the reason why “=” cannot be used for assignment)
  • 1==1 (C, C++, Javascript style comparison)

Similarly, a test for inequality can be written like this:

  • 1<>0 (SQL style comparison)
  • 1!=1 (C, C++, Javascript style comparison)

The templating language has also been designed to be as more-or-less intuitive as these things can be. For example, of you want to do math, you can simply write:

  • price*(1.0+taxrate/100.0) to calculate a price with sales taxes added]
  • foo:=1+2 to add one and two together and assign to the template-local variable “foo”

Each advanced personalization function can be used in one of two styles:

  • In a functional form, familiar to functional and SQL developers, e.g. foo(bar(variable)), or
  • In a pipeline-style syntax, like Liquid, where the function or operator works on the content that comes to it down the “pipe” (e.g. variable bar foo).

Note that in the latter case, FeedBlitz doesn’t use the pipe “|” symbol (unlike templating languages such as Shopify’s like Liquid). This is because (a) unnecessary, and (b) “|” is already used in FeedBlitz to mean “or” (as in “A or B” can be written as “A | B” or “A || B” or, indeed, “A or B”). If you wish to clarify order of operations you can use parentheses, or split the work into multiple statements via the “;” separator, or use multiple <$eval$> shortcodes.

To clarify what this all means using a simple example, to insert the hash of the recipient’s email you can write either of these:

  • <$eval MD5(email) $>
  • <$eval email MD5 $>

The first is a “functional” programming style approach; the second a pipe-like one. You simply chooses the style you prefer.

Moreover, you can seamlessly switch styles in the same statement, as in the following examples, all of which provide an upper case MD5 hash of a lowercase email address:

  • <$eval uppercase(MD5(lowercase(email))) $>
  • <$eval MD5(email lowercase) uppercase $>
  • <$eval email lowercase MD5 uppercase$>
  • <$eval uppercase(lowercase(email) MD5) $>

Typing, Testing, and Case Sensitivity

When you’re using a test to modify content, it’s important to know how those tests work. (In general terms, FeedBlitz’s templating language is weakly typed). Here are the rules:

  • True is represented as the number 1 or the string “1” depending on the context.
  • False is 0 or “0”.
  • An empty string is treated as false if it is used in a logical operation.
  • If both sides of a logical test can be interpreted as numbers, they will be.
  • Otherwise string comparisons will be used.

Other factors to consider:

  • String comparisons are usually case insensitive (i.e. “Phil”, “phil”, “pHiL”,and “PHIL” are all all equivalent.
  • Integer arithmetic is used unless on of the variables is obviously floating point (you can coerce floating point by multiplying a field value by 1.0, or by writing the number with a decimal point and at least one decimal place).