Email Listener
With the Email Listener, you can receive emails at a specific email address and process those emails using logic defined in the Builder.
How to configure
To configure the Email Listener, you need to set the handler parameter with the logic that will run when the Email Listener receives an email — it works very similarly to the HTTP Listener.
You can configure aliases for the Email Listener, which are email addresses that will be treated as the Email Listener's own address.
warning
Unique alias validation is not performed by the Builder, so there will be a conflict if you configure an alias that's already in use by another Email Listener.
Payload structure
The data available in the Email Listener payload are:
emailId: internal id of the Email Listener.headers: email headers as an object.subject: the email subject.attachments: list of URLs with the email's attachments and images. These files are saved in aDrive.from: an object with the sender's data.value: list of objects with the following data:address: sender's email address.name: sender's name.group: sender's email group.
text: address formatted as plain text.html: address formatted as HTML.
to: an object with the recipient's data.value: list of objects with the following data:address: recipient's email address.name: recipient's name.group: recipient's email group.
text: address formatted as plain text.html: address formatted as HTML.
cc: an object in the same format asto, for carbon-copy addresses.bcc: an object in the same format asto, for blind carbon-copy addresses.replyTo: an object in the same format asfrom, with the reply addresses.date: the email's date and time.messageId: the Message-ID value.html: the email body in HTML.text: the email body in plain text.textAsHtml: the email body formatted as HTML.destination: the recipient's email address. In this case, it's the address of the Email Listener that received the email.
Example payload:
{
"emailId": "ca1pj5l3ggbrld7h25b90riu2fp5hhce2j75cq01",
"attachments": [],
"headers": {
"return-path": {
"value": [
{
"address": "example@example.com",
"name": ""
}
],
"html": "<span class=\"mp_address_group\"><a href=\"mailto:example@example.com\" class=\"mp_address_email\">example@example.com</a></span>",
"text": "example@example.com"
},
"x-ses-spam-verdict": "PASS",
"x-ses-virus-verdict": "PASS",
"mime-version": "1.0",
"from": {
"value": [
{
"address": "example@example.com",
"name": "Example"
}
],
"html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Example</span> <<a href=\"mailto:example@example.com\" class=\"mp_address_email\">example@example.com</a>></span>",
"text": "\"Example\" <example@example.com>"
},
"date": "2025-04-07T23:05:23.000Z",
"subject": "Subject",
"to": {
"value": [
{
"address": "vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email",
"name": ""
},
{
"address": "example2@example.com",
"name": "Example"
}
],
"html": "<span class=\"mp_address_group\"><a href=\"mailto:vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email\" class=\"mp_address_email\">vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email</a></span>, <span class=\"mp_address_group\"><span class=\"mp_address_name\">Example</span> <<a href=\"mailto:example2@example.com\" class=\"mp_address_email\">example2@example.com</a>></span>",
"text": "vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email, \"Example\" <example2@example.com>"
},
"content-type": {
"value": "multipart/alternative",
"params": {
"boundary": "000000000000fe9cc7063238456b"
}
}
},
"subject": "Test 2",
"from": {
"value": [
{
"address": "example@example.com",
"name": "Example"
}
],
"html": "<span class=\"mp_address_group\"><span class=\"mp_address_name\">Example</span> <<a href=\"mailto:example@example.com\" class=\"mp_address_email\">example@example.com</a>></span>",
"text": "\"Example\" <example@example.com>"
},
"to": {
"value": [
{
"address": "vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email",
"name": ""
},
{
"address": "example2@example.com",
"name": "Example"
}
],
"html": "<span class=\"mp_address_group\"><a href=\"mailto:vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email\" class=\"mp_address_email\">vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email</a></span>, <span class=\"mp_address_group\"><span class=\"mp_address_name\">Example</span> <<a href=\"mailto:example2@example.com\" class=\"mp_address_email\">example2@example.com</a>></span>",
"text": "vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email, \"Example\" <example2@example.com>"
},
"messageId": "<CAALhj6YBwGx6Bz+c9oX3FrixYwMJmganZ859cfe-Bt_6DZxE6w@mail.gmail.com>",
"html": "<div dir=\"ltr\">Email body</div>\n",
"text": "Email body\n",
"textAsHtml": "<p>Email body</p>",
"destination": "vO7nZF1elH4SUfKXlYFb3@jealous-present-2035.data2.email"
}
Limitations
- It's not possible to configure a custom domain for the Email Listener.