Setting up Language detection in the email Campaign workflow

Setting up Language detection in the email Campaign workflow

Overview

Setting up variables and transitions for routing Email workitems by detected language

Language detection can be used to route text based work items. If Language detection is used then a single campaign and workflow can be used as opposed to creating a separate campaign per supported language

In order to set up language detection you need to add a few actions in the email campaign workflow

Save variable

  • Navigate to the Campaign you wish to add language detection
  • Scroll Down to the workflow
  • Edit the Begin State
  • From the components bar on the right drag and drop a save variable action
  • The save variable should be added before any workitem routing decisions are made in the workflow
  • The save variable action will be used to identify the text the system should analyze for categorization.
  • For simplicity of this example set the condition type to none
  • Expression for an Email workitem enter workitem.email.subject

in the expression field, this tells the system to capture the text in the email subject

  • Variable

You can name the variable whatever you want but make sure not to include spaces or special character. The variable will now contain the text that was contained in the expression. In this example let us call the variable EmailSubject

Adding Email Content

Email Content is used to capture the text located in the body of an email so that you can save it as a variable.

  • From the components bar on the right drag and drop the email content action
  • Variable Name

You can name the variable name whatever you want but make sure not to include spaces or special character. The variable will now contain the text in the body of the email. In this example let us call the variable emailContent

Adding Detect Language

  • From the components bar on the right drag and drop a Detect Language action
  • The Detect Language action should be added after the save variable and Email Content actions
  • For simplicity of this example set the condition type to none
  • In the text field enter
    workitem.data.EmailSubject + workitem.data.emailContent

(workitem.data.subjectVariable + workitem.data.emailBdyVariablle)

the system will be analyzing both the subject + the body of the email to detect a language

Adding Transitions

  • In order to route work items based on Language Detection you need to set up transitions.
  • The transitions will be executed in the order they appear starting from top to bottom
  • In order for the transitions to route based on Language Detected set the condition type to And
  • for the first transition under expression enter

workitem.detectLanguageResult.mostLikelyLanguage == the 1st language your organization supports

eg. if your organization wants to route work items based on French being detected you would enter

workitem.detectLanguageResult.mostLikelyLanguage == ‘fr’

  • In the State field select the state where you would like the workitem to route by choosing a state you have previously created from the drop down list.
  • for the second transition under expression enter

workitem.detectLanguageResult.mostLikelyLanguage == the 2nd language your organization supports

eg. if your organization wants to route work items based on Spanish being detected you would enter

workitem.detectLanguageResult.mostLikelyLanguage == ‘es’

  • In the State field select the state where you would like the workitem to route by choosing a state you have previously created from the drop down list.
  • Add transitions for each language that your organization supports

Currently you can access a list of language codes supported by google here.

https://developers.google.com/admin-sdk/directory/v1/languages

  • Best practice would be to create 1 more transition at the end of the workflow with a condition of None. This is done in case one of the languages is accidentally forgotten or deleted.
  • In the State field select the state where you would like the workitem to route when the language detection does not match any of the preceding transitions, by choosing a state you have previously created from the drop down list.

Click Here to Download Linked File

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.