# ⚙️getInbox()

> ### easyYOPmail.getInbox(\_mail, \_search, \_option)

{% tabs %}
{% tab title="parámetros" %}

| Título       | Tipo     | Descripción                                                                                                                |
| ------------ | -------- | -------------------------------------------------------------------------------------------------------------------------- |
| \_mail       | `string` | correo a consultar                                                                                                         |
| \_search     | `object` | <p><code>{</code></p><p><code>"content":\<string>,</code> </p><p><code>"subject":\<string></code></p><p><code>}</code></p> |
| \_option     | `object` | <p><code>{</code></p><p><code>"MAX\_PAGE":\<number></code></p><p><code>}</code></p>                                        |
| {% endtab %} |          |                                                                                                                            |

{% tab title="Respuesta" %}

| Título | Tipo            | Descripción                                                                                                                                                       |
| ------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| inbox  | `array[object]` | <p><code>\[{</code><br><code>id:string,</code><br><code>time:string,</code><br><code>subject:string,</code><br><code>content:string</code><br><code>}]</code></p> |

| Variable          | Tipo     | Descripción                           |
| ----------------- | -------- | ------------------------------------- |
| inbox.**id**      | `string` | Identificador único de cada correo    |
| inbox.**time**    | `string` | hora de recepción del correo          |
| inbox.**subject** | `string` | Título del correo                     |
| inbox.**content** | `string` | Resumen mostrado en la lista de inbox |

{% endtab %}
{% endtabs %}

## Ejemplo

```javascript
const easyYOPmail = require('easy-yopmail');

easyYOPmail.inbox('yourmail@yopmail.com').then(inbox=>{
 	console.log(inbox);
});

//respuesta
/*
[
  {
    id: 'e_ZwRjAmNkZGZ1ZGZ2ZQNjAGZkZQZ4Zj==',
    time: '8:51',
    subject: 'testing',
    content: 'mail summary'
  }
]
*/
```

{% hint style="info" %}
NOTA: para obtener el resultado se hace uso de [.then()](https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Promise/then)
{% endhint %}

{% hint style="danger" %}
&#x20;TODO:

* [ ] Deberia, permitir filtrar los resultados basado los parámetros que genera.

&#x20;
{% endhint %}
