Templates Migrator v2

Prev Next

This API enables you to migrate your templates to Insider, and reduce time spent on recreating templates. To complete this migration, get started with the following requirements:

1. Download the HTML of the email template from your vendor. Make sure that the HTML is covering the full content.
2. Make sure to have an application to execute the operations (e.g. Postman, etc.).
3. Generate the Email Template API key, and save it for later use in the payload. You can generate it on Inone Settings > Integration > Generate API Key > Email Content and Templates.
4. Extract related premigration variables via Insider's API.
5. Migrate templates with the extracted variables via Insider's API.

This API allows you to migrate your promotional emails. Transactional email type is not supported in template migration.

Your title goes here
You should migrate your email templates one by one. Each payload in the migrator API should be prepared to migrate only one downloaded template to Insider's email template library.

Extract premigration variables

Before migrating your templates, you need to extract the premigration Dynamic Attributes variables.

Dynamic Attributes

The response for the request will include a list of all unique dynamic attributes found in the template.

Your title goes here
If you want to map these before sending your template to Insider, you need to create custom dynamic attributes in Insider.

Each attribute ID corresponds to an attribute name on your template. See the complete list of System Fields and Their IDs.

To migrate your template, you must replace the attribute name with the corresponding Insider attribute name. See Insider's Default Attributes.

To replace these attribute names with Insider attributes, you can use the attribute names in the {{my_attribute_name}} format. If you want to replace a custom attribute, the format should be {{c_subscription_expiry_date}}.

For example, the response for extracting variables returns dynamic attributes [“name”, “em”]. You should replace them with Insider's corresponding attributes when sending the request to migrate your template. In this case, they will be replaced with name and email respectively in the request as follows:

"dynamic_attributes": {"em": "email", "name": "name"}

Endpoint and Headers

POST https://mail.useinsider.com/content/v1/template-migration/{vendorname}/extract-premigration-variables

Your title goes here
Please verify the vendors that are currently supported with the Insider support team. Then, replace {vendorname} with yourvendor name in lowercase.

Headers

HeaderSample ValueDescription
X-INS-AUTH-KEY1a2b3c4d5e6fThis Email Template key is required to authorize your request. Refer to API Authentication Tokens to generate your token.
Content-Typeapplication/jsonThis header specifies the media type of the resource.

Body Parameters

Before sending your request, make sure you create it within the following criteria:

  • Your template html should be in base64 format. 
  • Your template html should not contain any “view-in-browser” component, display conditions, email recommendations, coupon(s), or any other customized component.
ParameterDescriptionData TypeRequired
htmlYour template HTML in base64 formatStringYes

Sample Request

Every request made to the request endpoint requires a request body formatted in JSON

your title goes here
Make sure to replace the {vendorname} and auth key sample values in the request before sending your request.
Your title goes here
Only base64 format is supported for HTML.

The following is a sample request to extract the premigration variables.

curl --location --request POST 'https://mail.useinsider.com/content/v1/template-migration/{vendorname}/extract-premigration-variables' \
--header 'x-ins-auth-key: 1a2b3c4d5e6f' \
--header 'Content-Type: application/json' \
--data-raw '{
    "html": "VGhpcyBpcyBhbiBleGFtcGxlIGh0bWwgY29udGVudA=="
}'

The following is a sample response.

{
    "dynamic_attributes": ["em", "name"]
}

Migrate your template with extracted variables

To migrate your templates, you need to send them with the dynamic attributes if any.

Endpoint and Headers

POST https://mail.useinsider.com/content/v1/template-migration/{vendorname}/migrate

Your title goes here
Please verify the vendors, which are currently supported, with the Insider support team. Then, make sure to replace {vendorname} with your own vendor name in lowercase.

Headers

HeaderSample ValueDescription
X-INS-AUTH-KEY1a2b3c4d5e6fThis Email Template key is required to authorize your request. Refer to API Authentication Tokens to generate your token.
Content-Typeapplication/jsonThis header specifies the media type of the resource.

Body Parameters

Before sending your request, make sure you create it within the following criteria:

  • Your template html should be in base64 format. 
  • Your template html should not contain any “view-in-browser” component, display conditions, email recommendations, coupon(s), or any other customized component.
  • Your dynamic attribute IDs should have a corresponding Insider attribute name as explained in "Dynamic Attributes" section.
ParameterDescriptionData TypeRequired
template_nameThe name your template will haveStringYes
htmlYour template HTML in base64 formatStringYes
dynamic_attributesThe extracted attributes along with their corresponding attribute names at InsiderObjectYes

Sample Request

The following is a sample request to migrate your template with dynamic attributes.

Your title goes here
Make sure to replace the {vendorname} and auth key sample values in the request before sending your request.
curl --location --request POST 'https://mail.useinsider.com/content/v1/template-migration/{vendorname}/migrate' \
--header 'x-ins-auth-key: 1a2b3c4d5e6f' \
--header 'Content-Type: application/json' \
--data-raw '{
    "template_name": "My migrated template",
    "html": "VGhpcyBpcyBhbiBleGFtcGxlIGh0bWwgY29udGVudA==",
    "dynamic_attributes": {"name": "name", "em": "email"}
}'

The request above migrates a template with the "My migrated template" name. The attribute name and em have Insider's corresponding attribute names as name and email.

If your request is successful, your migrated template will be listed in Email Design > Choose Template > Custom Templates. You can select your template, and use the Drag & Drop Editor to edit it.


Limitations

  • All functions must be executed with a simple HTTPS POST request.
  • The API Key should be provided as the authorization key on the request header. If the key is incorrect, the operation will not be executed.
  • The rate limit is 60 requests per minute.
  • Templates with "view-in-browser" component at the top are not supported for migration.
  • Templates with display conditions are not supported for migration.
  • Templates with email recommendation and coupon functionalities are not supported for migration.