Generating a CSV file for Multilingual Push Notification generating-csv-multilingual-push
Uploading a CSV file to generate content for delivery is a feature used to support multilingual Push notifications. The format of the CSV file needs to adhere to certain guidelines for the file upload to be successful and consequently to be able to create a delivery. The following sections describe the file format and the considerations thereof.
File format file-format
Multilingual push requires 14 columns in the CSV file:
- title
- messageBody
- sound
- adge
- deeplinkURI
- category
- iosMediaAttachmentURL
- androidMediaAttachmentURL
- isContentAvailable
- isMutableContent
- customFields
- locale
- language
- silentPush
Check the CSV sample by clicking the Download a sample file in the Manage Content Variants window. For more on this, refer to the this section.
- title, messageBody, sound, badge, deeplinkURI, category, iosMediaAttachmentURL, androidMediaAttachmentURL: regular push payload contents. You need to provide this information in a similar manner as when creating push deliveries.
- Custom Fields: use JSON format for the custom fields, e.g.
{"key1":"value1","key2":"value2"}
. Refer to the sample file above for an example of custom fields. - isContentAvailable: flag for Content Available check, value 1 implies true, value 0 implies false. The default value is 0. If you leave this column blank, the value will be considered 0.
- isMutableContent: flag for Mutable Content, value 1 implies true, value 0 implies false. The default value is 0. If you leave this column blank, the value will be considered 0.
- locale: locale is the field for language variants, e.g. “en_us” for US-English and “fr_fr” for France-French.
- language: name of the language which is associated with the locale. For example, if locale is “en_us”, the name of the language should be " English-United States".
- silentPush: flag for the push notification type. If it is a regular push notification, the value should be 0. If it is a silent push, the value should be 1. The default value is 0. If you leave this column blank, the value will be considered 0.
Constraints and Guidelines for the creation of csv file constraints-guideline-csv
Name of each column is fixed.
You should include the name of each column in the CSV file, if you don’t use any columns for the content, leave it blank.
“locale” and “language” columns are mandatory and value is unique for each row.
A blank value for this column will result in a failure of the file upload.
Order of columns matters. The order of the columns in the uploaded file needs to follow the same format as the sample file.
Quote column content. Since this is a CSV (stands for Comma-Separated Values) file, any column content which includes comma (,) has to be quoted. For example, “Hello, Tom!”
UTF-8 encoding is necessary for international characters.
If you generate the file by plain text, separate each column by “,”.
Variant Mismatch. If you use content block and target audiences with specific languages, you need to list every targeted language in your CSV file or you will get error when sending the delivery.
Insertion of personalization field in the csv file personalization-field-csv
If you want to use personalization fields, you should include tag in the file.
To insert “firstName” personalization field in messageBody, the message needs to be:
"Hello <span class="nl-dce-field nl-dce-done" data-nl-expr="/context/profile/firstName">First name</span>, this is message".
“firstName” field is represented by:
<span class="nl-dce-field nl-dce-done" data-nl-expr="/context/profile/firstName">First name</span>
In the span there are two mandatory attributes:
-
One is class which is static. No matter which personalization field you plan to use, it will always be class=“nl-dce-field nl-dce-done”.
-
Another one is data-nl-expr which is the path of personalization field. For example, if you insert “firstName” personalization field from UI, the navigation path will be Context (context) > Profile (profile) > First name (firstName) (as shown in the image below). In this case, the path will be
code language-none /context/profile/firstName. data-nl-expr="/context/profile/firstName".
Locale and Language Names locale-language-names
The following languages are supported: