# mailinator

## delete

Deletes sepcific email.

\*\* Example of the returned object:\*\*

```json
{
 "status": "ok"
}
```

**Parameters:**

| Name | Type     | Description |
| ---- | -------- | ----------- |
| `id` | `String` | Message ID. |

**Returns:**

`Object` - Status.

## fetch

Fetches specific email.

\*\* Example of the returned object:\*\*

```json
{
 "data":
   {
     "fromfull":"noreply@example.com",
     "headers": { ... email headers ... },
     "subject":"test subject",
     "requestId":"REQUEST ID",
     "parts": [
       {
         "headers":{ "content-type":"text/plain; charset=utf-8" },
         "body":"EMAIL BODY (TEXT)"
       },
       {
         "headers":{ "content-type":"text/html; charset=utf-8" },
         "body":"EMAIL BODY (HTML)"
       }
     ],
     "from":"Test Tester",
     "origfrom":"Test Tester noreply@example.com",
     "to":"cb-test-2",
     "id":"RANDOMLY GENERATED ID",
     "time":1491200030000,
     "seconds_ago":1174
  },
 "apiEmailFetchesLeft":1999
}
```

**Parameters:**

| Name | Type     | Description |
| ---- | -------- | ----------- |
| `id` | `String` | Message ID. |

**Returns:**

`Object` - Email details. E.g.

## getBody

Extracts first available email body.

**Parameters:**

| Name       | Type     | Description                                |
| ---------- | -------- | ------------------------------------------ |
| `emailObj` | `Object` | Email object returned by mailiniator.fetch |

**Returns:**

`String` - Email body.

## getSubject

Extracts email's subject.

**Parameters:**

| Name       | Type     | Description                                |
| ---------- | -------- | ------------------------------------------ |
| `emailObj` | `Object` | Email object returned by mailiniator.fetch |

**Returns:**

`String` - Email subject.

## init

Initializes mailinator module.

**Parameters:**

| Name            | Type     | Description                                           |
| --------------- | -------- | ----------------------------------------------------- |
| `token`         | `String` | API token.                                            |
| `privateDomain` | `String` | `optional` Specifies whether to use a private domain. |

## list

Fetches inbox messages or all saved messages.

\*\* Example of the returned object:\*\*

```json
{
 "messages": [
   {
     "fromfull": "noreply@example.com",
     "subject": "Subject",
     "from": "Test Tester",
     "origfrom": "Test Tester noreply@example.com",
     "to": "inbox-name",
     "id": "RANDOMLY GENERATED ID",
     "time": 1491200030000,
     "seconds_ago": 234
   },
 ]
}
```

**Parameters:**

| Name    | Type     | Description                                                               |
| ------- | -------- | ------------------------------------------------------------------------- |
| `inbox` | `String` | `optional` Inbox name. If ommited saved messages will be fetched instead. |

**Returns:**

`Object` - List containing message details.


---

# Agent Instructions: 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:

```
GET https://docs.oxygenhq.org/download-installation-start/modules/module-mailinator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
