Zephyr Examples Library
Find each listed example on the reference page for the function(s) it employs.
Click the function’s link to view the example listed by name in the function’s Examples section.Name of Example | Available on Function Page | Example Type |
---|---|---|
Format Date from a Content Feed | date | Content |
Display Data Feed Content Links with First Article as ‘Featured’ | first, slice | Content |
Randomly Select Subject Lines from Content Feed Titles and Test Performance | random | Content |
Insert Ad Between Content Items | slice | Content |
Sort and Display Content by Date | sort | Content |
Sort and Display Content by Price | sort | Content |
Display Additional Content with Ad | ad, adinfo | Content |
Build Content Arrays Based on Feed Items’ Content Var Values | bucket_list | Content |
Remove Query Parameters from URLs in a Feed | contains, substr, strrpos | Content |
Give a Higher Weight to Highly Stocked Items | map | Content |
Clean HTML from a Data Feed | strip_tags | Content |
Create a Reader-Friendly Price | number | Content |
Interest-Based Content Recommendations from a Feed | horizon_select | Content |
Display the Intersection of User-Interested and Trending Content | content_intersect, length, push, filter, personalize | Content |
Show the Temperature from Various Cities from a Data Feed | keys, values | Content |
Set a Limit on the Number of Items Shown from a Certain Category | contains, keys, length, personalize, filter_content, slice | Content |
Replace Dashed Values from a Data Feed with Spaces | replace | Content |
Deduplicate Merged Feed Based on Title | filter_content, push | Content |
Filter Out Content with Empty ‘Image’ URL Value | filter, length | Content |
Converting Price (with a Decimal) from String to Number | map, int, substr, strrpos, strpos, length, number | Content |
Filtering for Content Between Two Price Points (Based on AOV_7) | filter_content | Content |
Limit a Description to a Certain Number of Characters | substr, strrpos | Content |
Display a Section Based on Pageview Count | horizon_count | Content |
Shuffle Each User’s Top 10 Personalized Items in a Template | personalize, shuffle | Content |
Personalize and Display User’s Top Story in a Hero Section and Other Stories in a Sub-Section | personalize, range | Content |
URL-Encode a Value | u | Content, User Profile |
Set User Interest on Link Click | join | Content, User Profile |
Display Content from a Feed Based on a User’s Geolocation | user_geo_home, distance, contains, round | Content, User Profile |
Show Feed Items that Match Terms in Custom Interest Array | contains | Content, User Profile |
Override User Interest Level with Custom Field Data (Tag Only) | time, horizon_set_interest | Content, User Profile |
Override User Interest Level with Custom Field Data (Tag and Score) | time, horizon_set_interest | Content, User Profile |
Show Feed Items that Match Terms in Custom Interest Array (With Fallback Content) | filter_content, personalize, contains, length | Content, User Profile |
Display Content with Vars Matching Users’ Interest/Subscription Variables | filter_content, dedupe, personalize, length | Content, User Profile |
Display Content Recommended Based on Past Purchases | personalize, slice | Content, User Profile |
Cancel Confirmed Opt-In if User Exists on List | cancel, contains | User Profile |
Cancel Send Based On User Var | api_user, cancel | User Profile |
Cancel Abandoned-Cart Series if Cart Emptied | cancel | User Profile |
Display User’s First Name from Full-Name Field | first | User Profile |
Capitalize the First Letter of Users Names in Templates | title | User Profile |
MD5-hash a user’s Email Address | md5 | User Profile |
Welcome Banner for New Signups | time | User Profile |
Dynamic Coupon Offer | time, length | User Profile |
Set Random Variable on Users for Future Cohort Testing | api_user, random | User Profile |
Set Current Date/Time as User Profile Field Value | api_user, date, time | User Profile |
Trigger a Dynamic Welcome Follow Up | api_send | User Profile |
Customized Subject Line Based on Engagement Level | user_engagement | User Profile |
Dynamic Message Based on Geolocation | user_geo_home | User Profile |
Check the Number of Purchases a User Has Ever Made | length | User Profile |
Create a Local Variable Based on Email Address | substr, strrpos | User Profile |
Split a List of Values Stored as a String | split, length | User Profile |
Force Lowercase a User Name | lower | User Profile |
Display a User’s Name in a Template in Title Case | title, lower | User Profile |
Display a User’s Name in All Caps | upper | User Profile |
Have a Dynamic Welcome Message Based on Last List Signup | push, sort, first | User Profile |
Display One-Click Signup Link if User Is Not on Certain List | contains | User Profile |
Show a Message Based on User’s Radius from Geographic Area | user_geo_select_region | User Profile |
Show a Countdown Clock Based on a User Variable | substr, strpos, date, time, int | User Profile |
Show a Prompt for a User to Login Based on a “last_login_date” Custom Field | time, int, abs | User Profile |
Pulling in Total Lifetime Purchase Amount | number | User Profile |
Recommend Complementary Items in an Order Confirmation Email | personalize, dedupe | User Profile |
Loop Through an Array of Objects on a User Profile | length, title | User Profile |
SHA1 Encrypt a User’s Email Address | sha1 | User Profile |
Show Today’s Date in Reader-Friendly Format | date, time | Other |
Create a Countdown Clock for a Certain Date | date, int, time | Other |
Add Ordinal Dates to the Current Date | date, int | Other |
Prompt Signup to Non-Subscribed Lists | push, filter, horizon_interest, set | Other |
Use Interest Data to Choose a Hero Image | horizon_interest | Other |
Cancel and Resend Template Based on a Date (Avoiding Weekends) | cancel, date, time, api_send | Other |
Include Dynamic Date for ‘Email Pause’ Opt-down Option in Optout Page | date, time | Other |
Taking Users Down a Custom Stream via a Transactional Trigger | api_event | Other |
Populate the Message ID in a Link Parameter | message_id | Other |
Insert a Unique Promotion Code | message_id | Other |