First steps
User Data
- Responsive Email Editor Review
- Designing your email
- Creating Synchronized Modules
- Setting Up Responsive Email Design
- Setting Up Smart Containers
- Creating a Gmail Promotions Annotation
- Adding The Rollover Effect
- Adding Anchor Links
- Module Library
- Adding a Table to an Email
- Adding Custom Fonts
- Creating CTA Button
- Working with Images
- Creating Timer
- Using AI in the Email Editor
Omnichannel
- Setting Up Widgets for Your Site
- Widget Calling
- Setting Up Locations for the Widget Calling Rules
- Storing data from widgets to contact fields
- Using Annoyance Safeguard
- Actions After Form Submission
- Replacing Double Opt-In System Workflow
- Creating Pop-ups via Google Tag Manager or WordPress
- Sending Yespo Widget Events to Google Analytics
- Using A/B Tests for Widgets
- Collecting Contact Information Using Request Forms
Automation
- Building and Editing Workflows
- Configuring Workflow Start/Stop Conditions
- Start Block
- Popular Blocks
- Message Blocks
- Using One from Many Message Block
- Contact Blocks
- Conditions Blocks
- Other Blocks
- Message to Segment Blocks
- Time Blocks
- Advanced Workflow Block Parameters
- Setting Up Allowed Send Time
- Using Workflow Launch History
- Webhook Workflows
- Workflow Troubleshooting
- Double Opt-In
- Welcome Сampaign
- Welcome Series Segmented by Category
- Launching a Workflow After a Contact Import
- Regular Workflow for a Segment
- Birthday Campaign
- Linking Workflow to the Button
- Using Variables from Order in Workflow
- Collecting Order Feedback
- Customer Reactivation
- Sending Extra Campaigns
- Sending Reminders at the Time Specified by the User
- Sending Campaign to Those Who Did Not Open the Previous One
- Using A/B Tests In Workflows
Personalization
Analytics
- Email Campaign Report
- Web Push Campaign Report
- Viber Campaign Report
- Mobile Push Campaign Report
- App Inbox Campaign Report
- Telegram Campaign Report
- In-App Report
- Widget Report
- Triggered Campaign Report
- AMP Campaign Report
- SMS Campaign Report
- Multilingual Campaign Report
- Setting up UTM Tags
- Revenue from Campaigns
- Tracking Campaign Performance in Google Analytics 4
- Message Analytics
Multilanguage Campaigns
Events and Behaviour Tracking
Recommendations
API
Security and Compliance
Promo Code Added via API
Let's see how to add promo codes to trigger messages using API methods:
- Generate event (via workflow),
- Send prepared message (without workflow).
Generate event method
The Generate event method allows you to send any custom events that can launch workflows.
To substitute a promo code transmitted via API into a trigger message, do the following:
- Set up the transfer of the necessary parameters in the event.
- Add a variable to the message.
- Create a workflow.
1. Setting event parameters
The event must contain a promo code and contact identifier for sending the message (e.g., an email address for sending an email or a phone number for SMS).
Event parameters:
{
"params": [
{
"name": "EmailAddress",
"value": "mail@example.com"
},
{
"name": "code",
"value": "ABC-123"
}
]
}
, where code is the variable's name used in the message, and ABC-123 is the promotional code the contact will receive.
2. Substituting variable in the message
Insert the variable's name containing the promo code into the message in the $!data.get('code') format. Instead of a variable, the contact will see the promo code passed in the event.
3. Creating the workflow
In the message block in the workflow, specify the event parameter that contains the contact identifier for sending the message (in our example, this is an email address; for other channels, use the appropriate IDs).
Read more about launching a workflow on an event in the instructions.
Send Prepared Message Method
The Send prepared message method allows you to send campaigns to one or more contacts.
You can send a unique promo code to each contact.
Request format:
{
"recipients": [{
"locator": "mail@example.com",
"jsonParam": "{\"code\":\"ABC-123\"}"
}],
"email": true
}
, where the recipients array contains elements with jsonParam. It can be used to send any data to a message, including a promo code. The data for the message must be in JSON format converted to a string.
Use message ID instead of {id} in https://esputnik.com/api/v1/message/{id}/smartsend request.
In the message, use a variable in the $!data.get('code') format.