API Presentation

API - Messages & Communication

A new V2 api was developed to handle Emailing, SMS sending with translation feature.

The new api is registered under /setting/internationalSettings.

It allow to fully update and partially update an EmailTemplate, also to create, get, update and delete an SMSTemplate.

Translation Feature :

Actually, when an email is sent from any sender like Invoicing or Dunning, the following fields are translated in the CustomerAccount Language .

  • Subject

  • TextContent

  • HtmlContent

The system checks if there is a translation in the target language in the table com_message_template, the table fields checked are: subject_i18n, textcontent_i18n, subject_i18n

Technical Design

SMSTemplate and EmailTemplate are two entities that extend MessageTemplate with the respective discriminator Values “EMAIL” and “SMS”

The structure of the translated fields, respectively for EmailTemplate and SMSTemplate are :

{
    "textContent": "text",
    "subject": "subject",
    "htmlContent": "html content",

    "translatedTextContent": [{
        "languageCode": "FRA",
        "textContent": "en français"
    }, {
        "languageCode": "ENG",
        "textContent": "en anglais"
    }],

    "translatedSubject": [{
        "languageCode": "FRA",
        "subject": "Mon texte"
    }, {
        "languageCode": "ENG",
        "subject": "my subject"
    }],

    "translatedHtmlContent": [{
        "languageCode": "FRA",
        "htmlContent": "Mon texte"
    }, {
        "languageCode": "ENG",
        "htmlContent": "my html content"
    }]
}


{
    "code": "SMS3",
    "textContent" : "My text content here",
    "translatedTextContent" : [ {
      "languageCode" : "FRA",
      "textContent" : "Mon texte"
    }, {
      "languageCode" : "ENG",
      "textContent" : "My text"
    } ]
}