EML_PARSE

Takes text containing EML (RFC822) content and parses out information such as to, from, subject, attachments, etc.

Syntax 

EML_PARSE(text)

Usage examples 

Example 1

Input

1
{
2
"my_action": {
3
"message": "Delivered-To: john@example.com\nDate: Fri, 20 Jan 2023 00:00:37 +0000\nFrom: John Smith john@example.com\nReply-To:john@example.com\nTo: john@example.com\nMessage-ID: <message_id>\nSubject: Example email\nMime-Version: 1.0\nContent-Type: multipart/alternative;\n boundary=\"--==_mimepart_63c9d9a544871_73eb214182db\";\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n\n----==_mimepart_63c9d9a544871_73eb214182db\nContent-Type: text/plain;\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\nA real email body could go here\n----==_mimepart_63c9d9a544871_73eb214182db\nContent-Type: text/html;\n charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n<!DOCTYPE html>\n<html>\n <head>\n <meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" />\n </head>\n <body>\n A real email body could go here\n </body>\n</html>\n\n----==_mimepart_63c9d9a544871_73eb214182db--"
4
}
5
}

Formula

EML_PARSE(my_action.message)

Output

1
{
2
"attachments": [],
3
"body": "<!DOCTYPE html>\n<html>\n <head>\n <meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" />\n </head>\n <body>\n A real email body could go here\n </body>\n</html>\n",
4
"cc": [],
5
"date": "2023-01-20T00:00:37+00:00",
6
"from": "John Smith john@example.com",
7
"headers": {
8
"Content-Transfer-Encoding": "7bit",
9
"Content-Type": "multipart/alternative; boundary=\"--==_mimepart_63c9d9a544871_73eb214182db\"; charset=UTF-8",
10
"Date": "Fri, 20 Jan 2023 00:00:37 +0000",
11
"Delivered-To": "john@example.com",
12
"From": "John Smith john@example.com",
13
"Message-ID": "<message_id>",
14
"Mime-Version": "1.0",
15
"Reply-To": "john@example.com",
16
"Subject": "Example email",
17
"To": "john@example.com"
18
},
19
"message_id": "message_id",
20
"subject": "Example email",
21
"to": [
22
"john@example.com"
23
]
24
}

Sample Actions 

Transform
My Action
Transform
EML_PARSE

Select an action to inspect.

You can also click "Copy actions" and paste them in your Tines story to see how they work.

Was this helpful?