v1.0.0
OpenAPI 3.1.0

Create an email translation

US region

Client Libraries

Create an email translation

Creates a new translation for an email. If content, envelope, and/or transformers are omitted, the values are copied from the default (parent) email.

Path Parameters
  • id
    Type: stringFormat: uuid
    required

    The UUID of the email. If your email has multiple languages, you must provide the ID of the default language template. This links the workflow to all of the language variants for the template.

Body
required
application/json

How content is inherited from the default, parent email:

  • If both content and envelope are omitted: envelope (including subject and preheader) is copied verbatim from the parent email
  • If content is provided but envelope is omitted: the envelope is reconstructed from the parent’s envelope settings, using the new subject and preheader
  • If envelope is provided but content is omitted: the provided envelope is used with the parent’s subject and preheader
  • HTML, AMP, and text body fields are always copied from parent if content is omitted
  • language
    Type: string
    required

    A language code that corresponds to the language of the translation

  • content
    Type: object

    The content of your email.

  • envelope
    Type: object

    The envelope of your email, like from and to addresses.

  • transformers
    Type: object

    Automate repetitive actions like removing white space and inlining CSS with transformers.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/design_studio/emails/{id}/languages
curl https://api.customer.io/v1/design_studio/emails/123e4567-e89b-12d3-a456-426614174000/languages \
  --request POST \
  --header 'Content-Type: application/json' \
  --data '{
  "language": "es",
  "content": {
    "subject": "",
    "preheader_text": "",
    "html": "",
    "amp": "",
    "text": ""
  },
  "envelope": {
    "from_id": null,
    "reply_to_id": null,
    "recipient": "",
    "bcc": "",
    "fake_bcc": true,
    "headers": [
      {
        "name": "",
        "value": ""
      }
    ]
  },
  "transformers": {
    "url_parameters": {
      "enabled": false,
      "parameters": []
    },
    "css_variables": {
      "enabled": false,
      "preserve": false
    },
    "css_inliner": {
      "enabled": false,
      "apply_style_tags": true,
      "preserve_important": false,
      "remove_style_tags": true,
      "preserve_font_faces": true,
      "preserve_media_queries": true,
      "preserve_keyframes": true,
      "preserve_pseudos": true,
      "inline_pseudo_elements": false,
      "apply_html_attributes": {
        "enabled": true,
        "apply_width_attributes": true,
        "apply_height_attributes": true,
        "apply_table_element_attributes": true
      }
    },
    "accessibility": {
      "enabled": false,
      "language": "",
      "add_lang_to_html": true,
      "add_dir_to_html": true,
      "add_lang_to_content": true,
      "add_dir_to_content": true,
      "add_role_to_tables": true,
      "add_vml_alt_text": true,
      "add_empty_alt_to_images": true,
      "add_title_to_head": true,
      "remove_button_role_from_links": true,
      "remove_zoom_meta_tag": true
    },
    "formatter": {
      "type": "none",
      "prettify": {
        "indent_character": "spaces",
        "indent_size": 2,
        "wrap_attributes": false
      },
      "minify": {
        "remove_line_breaks": false,
        "line_length_limit": 500,
        "remove_indentations": true,
        "remove_html_comments": "0",
        "remove_css_comments": true
      }
    },
    "prevent_widows": {
      "enabled": false
    },
    "encode_entities": {
      "enabled": false
    },
    "remove_unused_css": {
      "enabled": false,
      "whitelist": [
        ""
      ],
      "backend_markers": [
        {
          "heads": "",
          "tails": ""
        },
        {
          "heads": "{%",
          "tails": "%}"
        }
      ],
      "uglify": false
    }
  }
}'
{
  "email_translation": {
    "language_group_id": "123e4567-e89b-12d3-a456-426614174000",
    "language": "fr",
    "is_template": true,
    "is_linked": true,
    "parent_folder_id": null,
    "available_languages": [
      "en",
      "es"
    ],
    "created": 1773856017,
    "updated": 1773856017,
    "content": {
      "subject": "string",
      "preheader_text": "string",
      "html": "string",
      "amp": "string",
      "text": "string"
    },
    "envelope": {
      "from_id": null,
      "from": "string",
      "reply_to_id": null,
      "reply_to": "string",
      "bcc": "string",
      "fake_bcc": true,
      "headers": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "recipient": "string"
    },
    "transformers": {
      "url_parameters": {
        "enabled": false,
        "parameters": []
      },
      "css_variables": {
        "enabled": false,
        "preserve": false
      },
      "css_inliner": {
        "enabled": false,
        "apply_style_tags": true,
        "preserve_important": false,
        "remove_style_tags": true,
        "preserve_font_faces": true,
        "preserve_media_queries": true,
        "preserve_keyframes": true,
        "preserve_pseudos": true,
        "inline_pseudo_elements": false,
        "apply_html_attributes": {
          "enabled": true,
          "apply_width_attributes": true,
          "apply_height_attributes": true,
          "apply_table_element_attributes": true
        }
      },
      "accessibility": {
        "enabled": false,
        "language": "",
        "add_lang_to_html": true,
        "add_dir_to_html": true,
        "add_lang_to_content": true,
        "add_dir_to_content": true,
        "add_role_to_tables": true,
        "add_vml_alt_text": true,
        "add_empty_alt_to_images": true,
        "add_title_to_head": true,
        "remove_button_role_from_links": true,
        "remove_zoom_meta_tag": true
      },
      "formatter": {
        "type": "none",
        "prettify": {
          "indent_character": "spaces",
          "indent_size": 2,
          "wrap_attributes": false
        },
        "minify": {
          "remove_line_breaks": false,
          "line_length_limit": 500,
          "remove_indentations": true,
          "remove_html_comments": "0",
          "remove_css_comments": true
        }
      },
      "prevent_widows": {
        "enabled": false
      },
      "encode_entities": {
        "enabled": false
      },
      "remove_unused_css": {
        "enabled": false,
        "whitelist": [
          "string"
        ],
        "backend_markers": [
          {
            "heads": "",
            "tails": ""
          },
          {
            "heads": "{%",
            "tails": "%}"
          }
        ],
        "uglify": false
      }
    }
  }
}