mailinator
Provides methods for working with Mailinator service - www.mailinator.com

delete

Deletes sepcific email.
Example of the returned object:
1
{
2
"status": "ok"
3
}
Copied!
Parameters:
Name
Type
Description
id
String
Message ID.
Returns:
Object - Status.

fetch

Fetches specific email.
Example of the returned object:
1
{
2
"data":
3
{
4
"fromfull":"[email protected]",
5
"headers": { ... email headers ... },
6
"subject":"test subject",
7
"requestId":"REQUEST ID",
8
"parts": [
9
{
10
"headers":{ "content-type":"text/plain; charset=utf-8" },
11
"body":"EMAIL BODY (TEXT)"
12
},
13
{
14
"headers":{ "content-type":"text/html; charset=utf-8" },
15
"body":"EMAIL BODY (HTML)"
16
}
17
],
18
"from":"Test Tester",
19
"origfrom":"Test Tester [email protected]",
20
"to":"cb-test-2",
21
"id":"RANDOMLY GENERATED ID",
22
"time":1491200030000,
23
"seconds_ago":1174
24
},
25
"apiEmailFetchesLeft":1999
26
}
Copied!
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:
1
{
2
"messages": [
3
{
4
"fromfull": "[email protected]",
5
"subject": "Subject",
6
"from": "Test Tester",
7
"origfrom": "Test Tester [email protected]",
8
"to": "inbox-name",
9
"id": "RANDOMLY GENERATED ID",
10
"time": 1491200030000,
11
"seconds_ago": 234
12
},
13
]
14
}
Copied!
Parameters:
Name
Type
Description
inbox
String
optional Inbox name. If ommited saved messages will be fetched instead.
Returns:
Object - List containing message details.
Last modified 8mo ago