Add a translation to a newsletter
Add a language variant to a newsletter.
If you omit optional fields, the values from the default template are copied over untranslated. Make sure you translate all aspects of your default template.
You can't add language variants to a newsletter that has already been sent. You can't manage emails created with the drag-and-drop editor or Design Studio via this endpoint—use Create an email translation for Design Studio emails.
If the newsletter has A/B tests, use Add a translation to a newsletter test group instead.
- Type: integernewsletter
_id requiredThe identifier of a newsletter.
Add a language variant to a newsletter. The payload the endpoint accepts depends on the parent newsletter's channel type.
Add a language variant to an email newsletter. Requires
language,subject, andbody.- bodyType: stringrequired
The HTML body content for the variant.
- languageType: stringrequired
The language tag for the new variant, e.g.
es,fr,de. - subjectType: stringrequired
The subject line for the variant.
- bodyType: string
_amp The AMP HTML body content for the variant.
- bodyType: string
_plain The plaintext body content for the variant.
- preheaderType: string
_text The preheader text for the email variant.
- application/json
- 400
The request is invalid. Possible reasons include: the newsletter has already been sent, the newsletter has multiple test groups (add a translation to a test group instead), or the newsletter uses Design Studio or drag-and-drop editors.
- 404
The newsletter does not exist.
- 422
Validation error. Possible reasons:
languageis missing, required content fields are missing for the channel type, or the language variant already exists. - 429
Your request is over the 10-per-second limit.
curl https://api.customer.io/v1/newsletters/1/language \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--data '{
"language": "es",
"subject": "¡Hola, {{ customer.name }}!",
"preheader_text": "Mira nuestras últimas novedades",
"body": "<html><body><h1>¡Hola!</h1></body></html>",
"body_plain": "",
"body_amp": ""
}'
{
"newsletter": {
"id": 128275,
"deduplicate_id": "128275:1484870424",
"type": "email",
"content_ids": [
45
],
"name": "Weekly Product Update",
"sent_at": 1481653929,
"created": 1481653919,
"updated": 1481653929,
"recipient_segment_ids": [
42,
99
],
"tags": [
"Product Updates"
],
"subscription_topic_id": 5
}
}Returns the updated newsletter, including new content_ids.