get_personalized_preview
Preview personalized content by resolving user and event attribute placeholders for email, push, or SMS channels. Verify replacements before sending campaigns.
Instructions
Get a personalized preview with all {{UserAttribute[...]}} and {{EventAttribute[...]}} placeholders resolved.
channel: EMAIL, PUSH, or SMS. personalization_details: Dict with user_attributes, event_attributes, and/or event_name. event_name (str) is required when event_attributes are provided (event-triggered personalization). Example (user attrs): {"user_attributes": {"First Name": "Alice"}} Example (event attrs): {"event_name": "App Opened", "event_attributes": {"App_Version": "1.0"}} payload: Dict of content fields with placeholder strings to render. Example: {"subject": "Hello {{UserAttribute['First Name']}}", "body": "..."} All Jinja-style personalization expressions supported by MoEngage are passed through:
Content blocks: {{ContentBlock['block_name']}}
Product sets: {% if ProductSet.set_name %}...{% endif %}
Content API references: {{Content['api_name'].field}} custom_template_data: Use an existing template instead of inline payload. Requires both template_id and version. Example: {"template_id": "tmpl-abc", "version": "v1.0"} user_details: Optional identifier to resolve personalization against an actual MoEngage user profile. Requires both fields: {"identifier": "ID", "identifier_value": "USER_12345"}.
Provide either payload OR custom_template_data — not both, not neither.
Rate limit: 10,000/min.
Returns: {success: true, personalized_content: {payload: {...}}} on success. {success: false, error, status_code, api_response} on API error. {success: false, error: str} on validation failure (missing fields, invalid args).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | ||
| personalization_details | Yes | ||
| payload | No | ||
| custom_template_data | No | ||
| user_details | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||