new Message(mail, messageId)
Create a new Message adaptor owned by the given mail corresponding to the
given messageId.
Parameters:
| Name | Type | Description |
|---|---|---|
mail |
The owning fleet |
|
messageId |
Number | The message id of this instance |
Methods
-
del()
-
Delete a mail.
This makes an HTTP DELETE request to
/characters/{character_id}/mail/{mail_id}/. The route version isv1.On success, this resolves to an empty object.
This function must be used with an SSO token that has the following scopes:
esi-mail.organize_mail.v1
Returns:
A Promise that resolves to an empty object.
- Type
- Promise.<Object>
-
info()
-
Return the contents of an EVE mail. This route is cached for up to 30 seconds.
This makes an HTTP GET request to
/characters/{character_id}/mail/{mail_id}/. The route version isv1.On success, this resolves to contents of a mail. An example result is:
{ "body": "blah blah blah", "from": 90000001, "labels": [ 2 ], "read": false, "recipients": [ { "recipient_id": 0, "recipient_type": "recipient_type string" } ], "subject": "test", "timestamp": "2015-09-30T16:07:00Z" }This function must be used with an SSO token that has the following scopes:
esi-mail.read_mail.v1
Returns:
A Promise that resolves to the parsed JSON of the response.
- Type
- Promise.<Object>
-
update(labels, read)
-
Update metadata about a mail.
This makes an HTTP PUT request to
/characters/{character_id}/mail/{mail_id}/. The route version isv1.The route parameter,
contents, is built implicitly by the function. The function argumentlabelsmaps to thelabelsproperty of thecontentsroute parameter. The array length oflabelscan be at most25. The function argumentreadmaps to thereadproperty of thecontentsroute parameter.On success, this resolves to an empty object.
This function must be used with an SSO token that has the following scopes:
esi-mail.organize_mail.v1
Parameters:
Name Type Description labelsArray.<Number> Labels to assign to the mail. Pre-existing labels are unassigned. Array of label ids to attach to the message
readBoolean Whether the mail is flagged as read. True or false if the message is marked as read
Returns:
A Promise that resolves to an empty object.
- Type
- Promise.<Object>