First steps
User Data
- Email Builder Review
- Designing your email
- Creating a Synchronized Module
- Setting Responsivity
- Building Smart Containers
- Creating a Gmail Promotions Annotation
- Adding a Rollover Effect
- Adding a Background to an Email
- Adding Anchor Links
- Adding a Video to an Email
- Adding a Table to an Email
- Adding a Custom Font
- Adding Social Media Buttons
- Editing HTML and CSS
- Working with “Images” block
- Using AI in the Email Editor
Omnichannel
- SDK for Mobile Apps
- Managing mobile SDK access keys
- Connecting Mobile App
- Creating a Google Project for Mobile Push Notifications
- Creating Mobile Push Messages
- Setting Up Delivery and Clicks Analytics
- Deep Links and Universal Links
- Scheduled Mobile Push Message
- Sending Test Messages from the Event Debug View
- Setting Up Widgets for Your Site
- Widget Calling
- Storing data from widgets to contact fields
- Using Annoyance Safeguard
- Actions After Form Submission
- Yespo Extension for Google Chrome
- Creating Pop-ups via Google Tag Manager or WordPress
- Sending Yespo Widget Events to Google Analytics
- Replacing Double Opt-In System Workflow
- Setting Up Locations for the Widget Calling Rules
Automation
Personalization
Analytics
- Email Campaign Report
- Web Push Campaign Report
- Viber Campaign Report
- Mobile Push Campaign Report
- App Inbox Campaign 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
Multilanguage Campaigns
Events and Behaviour Tracking
Recommendations
API
Security and Compliance
Integration
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.