Using the Email/send method replace to Email/set + EmailSubmission/set when send new email #2636
Closed
vttranlina
started this conversation in
Ideas
Replies: 1 comment
-
|
Email/send was designed to handle PGP encrypted mailbox. For the sake of inter-operability I prefer we currenlty stick to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When trying to send a new email via the front end.
I see the jmap request has composited the
Email/set + EmailSubmission/setmethodI believe we can optimize it by a single method
Email/sendhere is sample request when sending new email
{ "using": [ "urn:ietf:params:jmap:submission", "urn:ietf:params:jmap:mail", "urn:ietf:params:jmap:core", "urn:apache:james:params:jmap:mail:shares" ], "methodCalls": [ [ "Email/set", { "accountId": "c8753f6b5cb8ace1413b587896006cada03f7edd84c211ec03769c078418a75e", "create": { "2f6e06a0-d23a-11ee-bc63-b1419afd5e2d": { "mailboxIds": { "fdce9cb0-8ad7-11eb-ba04-fff8ae2f0c36": true }, "subject": "test", "from": [ { "name": "Van Tung TRAN", "email": "[email protected]" } ], "to": [ { "name": "Van Tung TRAN", "email": "[email protected]" } ], "cc": [], "bcc": [], "replyTo": [ { "name": null, "email": "[email protected]" } ], "htmlBody": [ { "partId": "2f6db880-d23a-11ee-bc63-b1419afd5e2d", "type": "text/html" } ], "bodyValues": { "2f6db880-d23a-11ee-bc63-b1419afd5e2d": { "value": "<div>tttt<br><br></div>", "isEncodingProblem": false, "isTruncated": false } }, "header:User-Agent:asText": "Team-Mail/0.11.3 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" } } }, "c0" ], [ "EmailSubmission/set", { "accountId": "c8753f6b5cb8ace1413b587896006cada03f7edd84c211ec03769c078418a75e", "create": { "2f6e06a1-d23a-11ee-bc63-b1419afd5e2d": { "identityId": "af77b30d-6e7f-416b-8422-6e6646800124", "emailId": "#2f6e06a0-d23a-11ee-bc63-b1419afd5e2d", "envelope": { "mailFrom": { "email": "[email protected]" }, "rcptTo": [ { "email": "[email protected]" } ] } } }, "onSuccessUpdateEmail": { "#2f6e06a1-d23a-11ee-bc63-b1419afd5e2d": { "mailboxIds/fdd4de40-8ad7-11eb-ba04-fff8ae2f0c36": true, "mailboxIds/fdce9cb0-8ad7-11eb-ba04-fff8ae2f0c36": null, "keywords/$seen": true, "keywords/$draft": null } } }, "c1" ] ] }We can do it by Email/send
{ "using": [ "urn:ietf:params:jmap:submission", "urn:ietf:params:jmap:mail", "urn:ietf:params:jmap:core", "urn:apache:james:params:jmap:mail:shares" ], "methodCalls": [ [ "Email/send", { "accountId": "c8753f6b5cb8ace1413b587896006cada03f7edd84c211ec03769c078418a75e", "create": { "2f6e06a0-d23a-11ee-bc63-b1419afd5e2d": { "mailboxIds": { "fdce9cb0-8ad7-11eb-ba04-fff8ae2f0c36": true }, "subject": "test", "from": [ { "name": "Van Tung TRAN", "email": "[email protected]" } ], "to": [ { "name": "Van Tung TRAN", "email": "[email protected]" } ], "cc": [], "bcc": [], "replyTo": [ { "name": null, "email": "[email protected]" } ], "htmlBody": [ { "partId": "2f6db880-d23a-11ee-bc63-b1419afd5e2d", "type": "text/html" } ], "bodyValues": { "2f6db880-d23a-11ee-bc63-b1419afd5e2d": { "value": "<div>tttt<br><br></div>", "isEncodingProblem": false, "isTruncated": false } }, "header:User-Agent:asText": "Team-Mail/0.11.3 Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" } }, "onSuccessUpdateEmail": { "#2f6e06a1-d23a-11ee-bc63-b1419afd5e2d": { "mailboxIds/fdd4de40-8ad7-11eb-ba04-fff8ae2f0c36": true, "mailboxIds/fdce9cb0-8ad7-11eb-ba04-fff8ae2f0c36": null, "keywords/$seen": true, "keywords/$draft": null } } }, "c0" ] ] }Reference: linagora/tmail-backend#188
Beta Was this translation helpful? Give feedback.
All reactions