MSG_PARSE
Takes the contents of an .msg file (Outlook item/email) and parses out information such as to, from, subject, attachments, etc.
By default headers are truncated on newline characters. To parse full headers set the extract_multiline_headers optional parameter to TRUE.
By default the parsed email includes a single body field containing the HTML part if available, otherwise the text part. Set the single_body optional parameter to FALSE to replace body with separate body_html and body_text fields.
Output is consistent with EML_PARSE.
Categories: Data Parsing/Conversion
Syntax
MSG_PARSE(file, [extract_multiline_headers: FALSE], [single_body: TRUE])
Examples
Example 1
Input
1
{
2
"my_action": {
3
"message": {
4
"file_upload_1": {
5
"contents": "BASE64 Encoded .msg file contents",
6
"display_logo": true,
7
"name": "Sample MSG File.msg",
8
"type": "application/vnd.ms-outlook"
9
}
10
}
11
}
12
}
Formula
MSG_PARSE(BASE64_DECODE(my_action.message.file_upload_1.contents))
Output
1
{
2
"attachments": [],
3
"body": "<html>\n<body></body>\n</html>\n\n",
4
"cc": [],
5
"date": "2017-06-01T15:24:31+00:00",
6
"from": "from@domain.com",
7
"headers": {
8
"Content-Type": "multipart/alternative; boundary=\"----_=_NextPart_001_00c81914.63ca02d3\"",
9
"Date": "Thu, 01 Jun 2017 15:24:31 +0000",
10
"From": "from@domain.com",
11
"Message-ID": "c58b1b52f61f4789ba40339c6e993440",
12
"Mime-Version": "1.0",
13
"Subject": "creating an outlook message file",
14
"Thread-Topic": "creating an outlook message file",
15
"To": "to@domain.com",
16
"X-Unsent": "1"
17
},
18
"message_id": "c58b1b52f61f4789ba40339c6e993440",
19
"subject": "creating an outlook message file",
20
"to": [
21
"to@domain.com"
22
]
23
}
Sample actions
Select an action to inspect
You can also click "Copy actions" and paste them in your Tines story to see how they work.