Skip to main content

We need to send transactional (!) emails via API.
The reason behind the transactional emails are information about coupon codes and rules about misuse of coupon codes.
The template itself is saved on Klaviyo.
We only need to put in e-mail, first-name and some metadata.
The profiles that will get these emails are our customers already and have an active profile.

How does it work?

Hey ​@fxi 

Do you know how to utilize Send Email API endpoint? This allows you to send pre-designed templates stored in Klaviyo to specific recipients with dynamic data (like email, first name, and metadata)

so basically endpoint url should be - https://a.klaviyo.com/api/v1/email-template/pTEMPLATE_ID]/send

Method: Post 

and the payload should be something like this

{
"to": "customer_email@example.com",
"context": {
"first_name": "John",
"coupon_code": "SAVE20",
"rule_description": "This coupon is valid for one-time use only and cannot be combined with other offers."
}
}

I hope this helps and thank you for sharing your question here in the community.

Cheers

Arpit


Hey ​@fxi 

Do you know how to utilize Send Email API endpoint? This allows you to send pre-designed templates stored in Klaviyo to specific recipients with dynamic data (like email, first name, and metadata)

so basically endpoint url should be - https://a.klaviyo.com/api/v1/email-template/pTEMPLATE_ID]/send

Method: Post 

and the payload should be something like this

{
"to": "customer_email@example.com",
"context": {
"first_name": "John",
"coupon_code": "SAVE20",
"rule_description": "This coupon is valid for one-time use only and cannot be combined with other offers."
}
}

I hope this helps and thank you for sharing your question here in the community.

Cheers

Arpit

Hey,

isn’t the `send` endpoint heavily restricted?

Furthermore, it gives me: 

 

{

    "status": 403,

    "message": "You must specify an API key to make requests."

}

Even though I authenticated myself in the headers with `Authorization` and my Klaviyo-API-Key! 


Reply