> For the complete documentation index, see [llms.txt](https://resources.atriptech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://resources.atriptech.com/api-document/readme/webhook-overview/email-notification.md).

# Email Notification

{% hint style="info" %}
💬 **Need help?** If you're stuck, ask Eva on ATRIP for instant diagnostics.

<a href="https://www.atriptech.com/" class="button primary" data-icon="comments">Ask Eva</a>
{% endhint %}

Use this webhook when you need to process airline email activity tied to orders.

### Trigger

Atlas sends `email.all` when Atlas email capture receives an airline email for an order.

### What you should do

When you receive this event:

* store `orderNo` and `uniqueCode`
* classify the email by `emailCategory`
* fetch or archive the email content quickly if you need the full body
* route the event into support, schedule-change, or post-booking workflows when needed

### Endpoint

POST to the webhook URL you registered with Atlas.

### Fields to read first

* `type`
* `data.orderNo`
* `data.emailCategory`
* `data.emailSubject`
* `data.emailLink`
* `data.createTime`

### Typical payload

```json
{
  "cid": "XXXXX",
  "data": {
    "orderNo": "XXXXXX",
    "emailCategory": "Payment Success",
    "emailSubject": "easyJet booking reference: XXXXX",
    "emailLink": "http://example.com/email.eml",
    "createTime": "2024-01-05 10:54:26"
  },
  "notificationId": "20240105105430470MJMOR",
  "status": -1,
  "type": "email.all"
}
```

### Notes

* `emailLink` is temporary and expires quickly
* if you need long-term access, store the email payload at your side
* `status` is internal and should be ignored for business logic

{% tabs %}
{% tab title="Schema" %}
**`cid`**

* **Type:** String
* **Required:** Yes
* **Description:** Unique client identifier.
* **Default:** None
* **Example:** `"XXXXX"`

**`notificationId`**

* **Type:** String
* **Required:** Yes
* **Description:** Unique identifier for the notification event.
* **Default:** None
* **Example:** `"20240105105430470MJMOR"`

**`status`**

* **Type:** Integer
* **Required:** Yes
* **Description:** In this type of notification status always = -1. This is an internal field and should be ignored.
* **Default:** None
* **Example:** `-1`

**`type`**

* **Type:** String
* **Required:** Yes
* **Description:** Notification type.
* **Default:** None
* **Example:** `"email.all"`

**`data`**

* **Type:** Object
* **Required:** Yes
* **Description:** Contains email-related details.
* **Default:** None
* **Example:** `{ ... }`

**`data.orderNo`**

* **Type:** String
* **Required:** Yes
* **Description:** Order number associated with the email.
* **Default:** None
* **Example:** `"XXXXXX"`

**`data.emailReceivingDate`**

* **Type:** String
* **Required:** Yes
* **Description:** Date and time when the email was received by Atlas (UTC). Format: `YYYY-MM-DD HH:mm:ss`.
* **Default:** None
* **Example:** `"2024-01-05 10:54:21"`

**`data.uniqueCode`**

* **Type:** String
* **Required:** Yes
* **Description:** Unique code for identifying the email.
* **Default:** None
* **Example:** `"e4afbecfd5727817ff73a71a94a2a64d"`

**`data.emailCategory`**

* **Type:** String
* **Required:** Yes
* **Description:** Atlas email categories. Atlas categorizes emails but does not guarantee accuracy in classification.
* **Valid values:**
  * Schedule change
  * Receipt
  * Payment Success
  * Verification
  * Trip Reminder
  * Promo code
  * Travel Itinerary
  * Advertisement
  * PNR Cancellation Success
  * Payment Due
  * Unidentified
  * Duplicated Schedule Change
  * Unaccounted Cancellation
* **Default:** None
* **Example:** `"Payment Success"`

**`data.from`**

* **Type:** String
* **Required:** Yes
* **Description:** Sender’s email address.
* **Default:** None
* **Example:** `"donotreply@easyjet.com"`

**`data.to`**

* **Type:** String
* **Required:** Yes
* **Description:** Recipient’s email address.
* **Default:** None
* **Example:** `"NSDLZCQTGJTEYXOMFOD@gorn.top"`

**`data.emailSubject`**

* **Type:** String
* **Required:** Yes
* **Description:** Subject of the email.
* **Default:** None
* **Example:** `"easyJet booking reference: XXXXX"`

**`data.emailLink`**

* **Type:** String
* **Required:** Yes
* **Description:** URL link to access the email content. Email Link is only valid for 10 mins.
* **Default:** None
* **Example:** `"http://order-oss-sg.oss-ap-southeast-1.aliyuncs.com/...eml?Expires=1704426870..."`

**`data.createTime`**

* **Type:** String
* **Required:** Yes
* **Description:** Create Time is the time when Atlas created this email record in the Email list. Generally, it will be later than the receiving time. Format: `YYYY-MM-DD HH:mm:ss`.
* **Default:** None
* **Example:** `"2024-01-05 10:54:26`
  {% endtab %}

{% tab title="Samples" %}

```json
{
    "cid":"XXXXX",
    "data":{
        "orderNo":"XXXXXX",
        "emailReceivingDate":"2024-01-05 10:54:21",
        "uniqueCode":"e4afbecfd5727817ff73a71a94a2a64d",
        "emailCategory":"Payment Success",
        "from":"donotreply@easyjet.com",
        "to":"NSDLZCQTGJTEYXOMFOD@gorn.top",
        "emailSubject":"easyJet booking reference: XXXXX",
        "emailLink":"http://order-oss-sg.oss-ap-southeast-1.aliyuncs.com/2024/01/e4afbecfd5727817ff73a71a94a2a64d.eml?Expires=1704426870&OSSAccessKeyId=LTAI5tDmTE9iwtNdsqxVXuom&Signature=zF8aNNsGgY8n2jhsW7V1gmPLw8c%3D",
        "createTime":"2024-01-05 10:54:26"
    },
    "notificationId":"20240105105430470MJMOR",
    "status":-1,
    "type":"email.all"
}
```

{% endtab %}
{% endtabs %}

### Related pages

* [Email Query](/api-document/readme/utility-api-overview/email-query.md)
* [Incident Notification](/api-document/readme/webhook-overview/incident-notification.md)
* [Webhook Overview](/api-document/readme/webhook-overview.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://resources.atriptech.com/api-document/readme/webhook-overview/email-notification.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
