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 argumentlabels
maps to thelabels
property of thecontents
route parameter. The array length oflabels
can be at most25
. The function argumentread
maps to theread
property of thecontents
route 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 labels
Array.<Number> Labels to assign to the mail. Pre-existing labels are unassigned. Array of label ids to attach to the message
read
Boolean 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>