AI assistant for personalization expressions generative-personalization-expressions
Overview where-available
AI Assistant helps you generate new personalization from plain language, explain what existing expressions do, and fix issues in selected code, so that you spend less time on syntax and manual field discovery. You can also iterate on a selection or ask for other changes in conversation. It is available from two entry points:
- Personalization Editor — wherever the editor is available (subject line, body, and other fields that open it). For where and how to open the editor, see Add personalization.
- Email Designer inline text editing — directly from the inline editing popover when editing a text component. See Generate from the Email Designer.
For broader AI Assistant setup and languages, see Get started with AI Assistant. For personalization concepts, see Get started with personalization. For prompt ideas, see AI prompt best practices.
Depending on your campaign or journey context, the assistant can work with data and constructs the Personalization Editor already exposes — for example profile attributes, segment membership, helper functions, and related personalization sources.
Generate personalization expressions generate
These steps cover generating personalization expressions from scratch. To work with code already in the editor, see Edit, fix or explain existing code.
-
In your message or content, open the Personalization Editor.
-
Place your cursor in the editor where you want generated personalization code to be inserted, then click the AI Assistant button.
-
In the text field, describe the personalization expression you want in plain language — for example which profile attributes, segments, or logic you need, then click Generate.
You can also use ready-to-use prompts from the Quick Prompts section, such as personalized greeting, promo code generation, and more.
note NOTE Any unrelated prompt or question returns an out-of-scope error. Adjust your prompt and ask a relevant question about the personalization you need. -
You can keep discussing with the assistant in a multi-turn conversation: it keeps context from your prompts so you can refine the same expression step by step. To start over, click the New session button.
-
After you generate an expression, click Show previews for sample profiles to see how the expression evaluates with sample data and to view the associated payload as JSON. For this check, the assistant generates a limited set of synthetic sample profiles; they are not saved or stored in your organization.
If you need custom or additional sample profiles, describe what you need in the discussion with the assistant and include the keyword preview in your prompt so it can generate the right preview profiles for your check.
accordion Preview example
note NOTE Additional previews are for spot checking. The assistant is tuned to generate roughly one to five profiles, asking for a very large number may cause the request to fail. note NOTE This control is for a quick check of your personalization code in the editor — not a full message preview of your content. For complete validation of the experience, use your usual simulation flow. Learn how to preview & test your content -
To implement the output in your personalization expression, click Apply. The assistant output is inserted at the cursor location in the personalization editor. To replace code that is already there instead, select that code in the editor first, then use Edit with AI Assistant (see Edit, fix or explain existing code).
You can also copy the output and paste it where you need it using the
icon.
Edit, fix or explain existing code edit-existing
You can select an existing personalization expression and use AI Assistant to fix personalization issues, explain what the code does, or ask for other changes.
-
Select existing personalization code in the editor.
-
Right-click the selection and choose Edit with AI Assistant so the assistant uses your selection as context.
-
AI Assistant opens. In Quick Commands, click Explain or Fix, or use the text field to ask for other changes and start a conversation.
-
When you use Fix, click Show fix details in the discussion to show an explanation of the fix and a line-by-line before and after preview.
-
As when you generate a personalization expression, click Apply to implement the assistant output. It replaces the code you had selected in the personalization editor. For example, if you asked for an explanation of the code, applying will add comments in the expression that describe what it does.
Generate from the Email Designer generate-email-designer
AI Assistant for personalization expressions is also available directly from the inline editing experience in the Email Designer, without opening the full Personalization Editor. The generated expression is inserted at the cursor position in the text component.
-
In the Email Designer, select a text component and start editing it inline.
-
Open the inline personalization popover in one of two ways:
- Type
{{at the position where you want the expression inserted — the popover opens automatically. - Click Use AI to generate in the inline editing popover if it is already open.
- Type
-
In the text field, describe the personalization expression you want in plain language, then click Generate.
-
Review the result in the Expression tab to see the generated expression.
Switch to the Preview tab to see how the expression evaluates using sample profile values, so you can verify the output before inserting it.
-
Click Insert to apply the expression at the cursor position in the text component. Use Regenerate to produce a new suggestion, or Reset to start over.