Description
- Why
Email query allows retrieving the mailboxId of (among others) the INBOX. It empowers a single request load for INBOX (woop)
-
- DOD
- Write an integretion test loading, for the connected user, without using any provisioned id in the request, loads the 20 first mail previews in the INBOX mailbox.
(sentAt sorting, ascending, 30 last items)
-
- How
Implement the email query method in order to resolve mailbox by role (`role` filter condition). Any other role/filter should be ignored/
Write integretaion tests for this method. Don't forget to document the limitation.
`sortAsTree` and `filterAsTree` should not be supported.
JsonPath resolution might also need in array resolution:
```
{ "resultOf": "c1", "name": "Mailbox/query", "path": "list[0]" }```
-
- Example
Here is a single request example:
```
{
"using": [
"urn:ietf:params:jmap:core",
"urn:ietf:params:jmap:mail"],
"methodCalls": [[
"Mailbox/query",
{
"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
"filter":
},
"c1"]]
}
```
Would reply:
```
{
"sessionState": "75128aab4b1b",
"methodResponses": [[
"Mailbox/query",
,
"c1"
]]
}
```
Here is an example query for full account loading :
```
{
"using": ["urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail"],
"methodCalls": [[
"Mailbox/query",
{
"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
"filter":
},
"c1"
],[
"Email/query",
{
"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6"
"filter" {
"#inMailbox":
},
"sort"
},
"c2"],[
"Email/get",
{
"accountId": "29883977c13473ae7cb7678ef767cbfbaffc8a44a6e463d971d23a65c1dc4af6",
"properties": ["id", "preview"],
"#ids":
},
"c3"]
]
}
```