General step-by-step guide
Here's how you can create a data-only send for Klaviyo.
- Create a template
Log in to Klaviyo and create an email template. Use placeholder variables where dynamic content should go. For example:
<p>Hey {{ first_name }},</p>
<p>We have a special offer just for you!</p>
<p>Use {{ offer_code }} to get 10% off your next purchase!</p>
- Find the template ID
Once the template is created, you can get the template ID by viewing the template in the Klaviyo dashboard.
- Log in to your Klaviyo account and go to the Dashboard.
- From the left-hand sidebar, click on "Campaigns" (or "Flows", depending on your setup).
- Under "Campaigns" (or "Flows"), you'll see an option called "Email Templates" in the dropdown menu. Click on "Email Templates".
- You will see a list of your email templates. Click on the template you want to use. You'll see the template ID (an alphanumeric string) in the URL. For example:
https://www.klaviyo.com/email-templates/T-12345abc-6789-def0-1234-ghij56789klm
(Alternate Method)
If you have your private API key handy, you can also use Klaviyo's API to list the IDs of all your email templates.
GET https://a.klaviyo.com/api/v1/templates/
The response will look something like this:
{
"data": [
{
"id": "T-12345abc-6789-def0-1234-ghij56789klm",
"name": "Welcome Email Template",
"subject": "Welcome to Our Service!",
"from_email": "[email protected]",
"from_name": "Your Brand",
"preview_text": "We're glad to have you onboard. Check out your exclusive benefits!",
"created": "2023-04-01T14:23:11Z",
"updated": "2023-04-01T14:23:11Z"
},
{
"id": "T-23456bcd-7890-ef01-2345-hijk67890lmn",
"name": "Special Offer",
"subject": "Your Special Offer Inside!",
"from_email": "[email protected]",
"from_name": "Marketing Team",
"preview_text": "Don't miss out on your exclusive discount. Shop now and save!",
"created": "2023-04-10T10:15:00Z",
"updated": "2023-04-10T10:15:00Z"
}
]
}
- Prepare the payload
Create a properly formatted JSON structure. Include the template ID and the variables that will populate the placeholders. Note, the "to" field takes in an array. You can have multiple recipients, each with different dynamic fields.
{
"data": {
"template_id": "YOUR_TEMPLATE_ID",
"from_email": "[email protected]",
"from_name": "Your Brand",
"subject": "Special Offer Just for You!",
"to": [
{
"email": "[email protected]",
"first_name": "John",
"offer_code": "DISCOUNT123"
},
{
"email": "[email protected]",
"first_name": "Jane",
"offer_code": "SUMMER2024"
}
]
}
}
Field Guide
template_id: The ID of your Klaviyo template.
from_email: The email address you want to send from.
from_name: The sender’s name.
subject: The subject of the email.
to: This is a list of recipients. Recipients can have different dynamic fields.
email: The email address you want to send to.
{{first_name}} will become "John" for the first recipient and "Jane" for the second recipient.
{{offer_code}} will become "DISCOUNT123" for the first recipient and "SUMMER2024" for the second recipient.
- Send the request
POST the payload to Wunderkind.
POST https://api-gateway.wunderkind.co/v1/inbox/sendemail
If everything is set up correctly, you'll get a response that looks like this:
{
"data": {
"message": "The email has been sent successfully.",
"recipients_sent": 2,
"campaign_id": "1234567890",
"email_template_id": "EMAIL_TEMPLATE_ID"
},
"status": "success"
}
Response Guide
200 OK: Success (email sent successfully).
4xx: Client-side errors (e.g., missing required fields).
5xx: Server-side errors (e.g., temporary issues with the Klaviyo API server).
And that's it. You just created a data-only send! 🎉