Advanced email templating
Advance Email Templating allows for highly customized email templates. It can be used in both the drag-and-drop editor and directly on imported HTML.
Bird Email Template Language Documentation
Introduction
The Bird Email Template Language is a powerful tool based on Shopify's Liquid syntax, with custom extensions designed specifically for email marketing. This language allows you to create dynamic, personalized email templates efficiently, enabling you to deliver targeted content to your subscribers.
Key features of the Bird Email Template Language include:
Easy personalization using predefined variables
Conditional content display based on subscriber attributes or segments
Integration with your product catalog and external data sources
Support for internationalization through translations
Advanced formatting options with filters
This guide will walk you through the essential components of the language, providing examples and best practices to help you create effective email templates.
For a comprehensive reference on the underlying Liquid syntax, please refer to the Shopify Liquid documentation.
Predefined Variables
Predefined variables allow you to easily personalize your emails with recipient information and organization details.
Contact Variables
Use these to insert recipient-specific information into your emails:
You can also use any custom attributes that you've defined for your contacts.
Organization Variables
Include your company information consistently across all emails:
Email Address Variable
Reference the recipient's email address directly:
Best Practice: Always have a fallback for personalization variables in case they're not set for a particular recipient.
Special Tags
Special tags provide quick access to common email marketing requirements, such as unsubscribe links and web views.
Unsubscribe Links
Essential for compliance with email regulations:
Web View Links
Provide an option to view the email in a web browser:
Date Tags
Useful for displaying current dates in your emails:
Best Practice: Always include an unsubscribe link in your emails, typically in the footer.
Control Flow
Conditional logic and loops allow you to create dynamic content that adapts to each recipient's attributes or preferences.
If Statements
Use if statements to show different content based on recipient attributes:
Checking Segment Membership
Target content to specific segments of your audience:
Case Statements
Loops
Iterate over arrays of data to create dynamic lists:
Best Practice: Use conditional logic to tailor your message to different audience segments, increasing relevance and engagement.
Working with Products
Integrate your product catalog directly into your email templates for dynamic product displays.
Single Product Lookup
Display details of a specific product:
Product Feed
Display multiple products from a feed:
Best Practice: Use product feeds to create dynamic content like "Recommended Products" or "New Arrivals" sections in your emails.
Events
Leverage event data to create highly relevant, timely emails based on subscriber actions.
Best Practice: Use event data to trigger timely, relevant emails such as abandoned cart reminders or purchase confirmations.
Discount Codes
Generate and display unique discount codes in your emails to incentivize purchases.
Best Practice: Use unique discount codes to track the performance of different email campaigns or segments.
Translations
Create multilingual email templates using the translation feature.
First, set up your translation files (in JSON format) for each language you support. For example:
Then use the t filter in your templates:
Best Practice: Use translations to create a single template that can be used for multiple languages, reducing maintenance overhead.
External Data Sources
Integrate real-time data from external sources into your emails. You can learn more about external data sources here.
External Data SourcesBasic Usage
Using Dynamic URLs
For APIs that require dynamic parameters:
Best Practice: Use external data sources to include up-to-date, personalized information in your emails, such as account balances, loyalty points, or personalized recommendations.
Supported Liquid Filters
Text Formatting
Filter: capitalize
Capitalizes the first letter of a string.
Filter: upcase
Converts string to uppercase.
Filter: downcase
Converts string to lowercase.
Filter: strip
Removes leading and trailing whitespace from strings.
Filter: lstrip
Removes leading (left) whitespace from strings.
Filter: rstrip
Removes trailing (right) whitespace from strings.
Filter: append
Appends text to the end of a string.
Filter: prepend
Prepends text to the beginning of a string.
Filter: replace
Replaces all occurrences of a substring.
Filter: replace_first
Replaces only the first occurrence of a substring.
Filter: remove
Removes all occurrences of a substring.
Filter: remove_first
Removes only the first occurrence of a substring.
Filter: slice
Extracts a substring starting at a position with optional length.
Filter: truncate
Truncates a string to a specified length, adding "..." if truncated.
Filter: truncatewords
Truncates a string to a specified number of words.
Filter: escape
Escapes HTML characters in strings.
Filter: escape_once
Escapes HTML characters, but doesn't double-escape already escaped characters.
Filter: strip_html
Removes HTML tags from strings.
Filter: strip_newlines
Removes newline characters from strings.
Filter: newline_to_br
Converts newline characters to HTML <br> tags.
Filter: url_encode
URL-encodes strings for safe use in URLs.
Filter: url_decode
URL-decodes strings.
Filter: titleCase
Converts text to title case, lowercasing small words.
Filter: titleCaseKeepAllCaps
Converts text to title case while preserving fully uppercase words.
Arrays and Collections
Filter: join
Joins array elements with a separator.
Filter: split
Splits strings into arrays using a delimiter.
Filter: size
Returns the size of strings or arrays.
Filter: first
Gets the first element of an array.
Filter: last
Gets the last element of an array.
Filter: where
Filters arrays by property values.
Filter: sort
Sorts arrays in ascending order.
Filter: sort_natural
Performs natural sorting (handles numbers in strings properly).
Filter: reverse
Reverses the order of array elements.
Filter: uniq
Removes duplicate elements from arrays.
Filter: compact
Removes nil/null items from arrays.
Filter: concat
Combines two arrays into one.
Filter: map
Extracts a specific property from each array element.
Default Values
Filter: default
Provides default values for nil/empty variables.
Currency Formatting
Filter: currencyFormat
Formats currency values with locale-specific formatting.
Best Practice: Use the currencyFormat filter for all price displays to ensure consistency and proper formatting across different regions.
Filter: moneyWithoutCurrency
Formats numbers as currency without currency symbols, with custom separators.
Math & Numbers
Filter: abs
Returns the absolute value of a number.
Filter: ceil
Rounds a number up to the nearest integer.
Filter: floor
Rounds a number down to the nearest integer.
Filter: round
Rounds a number to the nearest integer or specified decimal places.
Filter: plus
Adds numbers together.
Filter: minus
Subtracts numbers.
Filter: times
Multiplies numbers.
Filter: divided_by
Divides numbers.
Filter: modulo
Returns the remainder of division.
Date & Time
Filter: date
Formats dates using strftime patterns.
Filter: timezone
Converts timestamps to different timezones.
Data Lookup
Filter: lookup
Retrieves data from lookup tables with nested key support.
Encoding
Filter: base64_encode
Encodes values using standard base64 encoding.
Filter: base64_decode
Decodes base64 encoded strings.
Filter: base64url_encode
Encodes values using URL-safe base64 encoding (RFC 4648).
Filter: base64url_decode
Decodes URL-safe base64 encoded strings.
Utility & Debug
Filter: json
Converts values to JSON format.
Filter: inspect
Returns a debug representation of a value.
Filter: type
Returns the type of a value.
Notes
Base64 filters have a 1MB input size limit for security
Currency formatting defaults to
en-USlocale when not specifiedWhere filter supports both property existence checks and value matching
Lookup tables are cached during template rendering for performance
For a comprehensive guide on these advanced Liquid features, please refer to the Shopify Liquid documentation.
Best Practice: While these advanced features are powerful, use them judiciously. Overly complex templates can be difficult to maintain and may impact email rendering performance.
Remember to thoroughly test your email templates across different email clients to ensure consistent rendering and optimal performance. The Bird platform provides tools for previewing and testing your templates before sending.
By mastering the Bird Email Template Language, you'll be able to create highly dynamic, personalized, and engaging email campaigns that resonate with your audience and drive results.
Last updated
Was this helpful?

