Split Email Conversations
Verb: conversationParser
Available from: <Standard>
Split existing conversations into an email message, so that these conversations are organized into a list.
Syntax
conversationParser --text(String) (List<String>)=value
Inputs
| Script | Designer | Required | AcceptedTypes | Description |
|---|---|---|---|---|
| --text | Text | Required | Text | Body of the email message that will be split.
The variable containing the body text of the email message is obtained by returning the Email Body parameter of the Read Email command. |
Outputs
| Script | Designer | AcceptedTypes | Description |
|---|---|---|---|
| value | Email Structure | List<Text> | Returns a list of conversations retrieved from an email message. |
Example
After obtaining the body of the email message using the Read Email command, from a connection to an email server, the Split Email Conversations command is used to read and identify the conversations contained in the message, splitting these conversations and assigning them to a list.
defVar --name emailToSplit --type EmailMessage
defVar --name emailConversations --type List --innertype String
defVar --name emailConnection --type EmailConnection
defVar --name emailSubject --type String
defVar --name emailBody --type String
defVar --name htmlBody --type String
imapConnect --mailhost "outlook.office365.com" --mailport 993 --usessl --username "useremail@email.com" --mailusername "useremail@email.com" --mailpassword userpassword --enableLog emailConnection=value
foreach --collection "${emailConnection}" --variable "${emailToSplit}"
emailRead --message ${emailToSplit} emailSubject=subject emailBody=body htmlBody=htmlbody
conversationParser --text "${emailBody}" emailConversations=value
logMessage --message "Email Body: ${emailBody}\r\nObtained conversations after split: ${emailConversations}" --type "Info"
endFor
It is necessary to have access to an email account and inform the port and host settings in the Connect to IMAP Email Server command, to execute the command.