Personalization and Content Generation
Personalization and content generation
Personalization merges data from the delivery target, the delivery itself, and workflow variables into content. The two delimiters are <%= expression %>, which outputs a value, and <% code %>, which executes JavaScript without output. Fields come from the targeting dimension (often recipient) and from targetData; delivery properties are available through delivery. Content blocks and templates let you reuse boilerplate, while conditional blocks and JavaScript conditionals generate variant content. The Interaction module adds offers, but offers still need eligibility and typology checks.
Always provide fallbacks. A recipient with an empty first name should not produce “Hello ,”. Escape or validate user-generated values that appear in HTML or URLs. Preview with test profiles that represent edge cases: empty fields, different languages, and different target schemas. Personalization is resolved during analysis and preparation; a value that changes after preparation may not appear in the sent message.
Traps and rule of thumb
Subject-line personalization follows the same rules as body content. targetData is not available everywhere; in a web application the context is different. Including JavaScript in content can create security and performance problems, and some clients strip it.
Worked example: Hello <%= (recipient.firstName && recipient.firstName.length > 0) ? recipient.firstName : 'customer' %> produces a safe greeting. Rule: every personalization token needs a defined fallback and a test profile that exercises it.