Skip to content

[_]: feature/mail EPs#380

Merged
xabg2 merged 5 commits intomasterfrom
feature/mail
Mar 26, 2026
Merged

[_]: feature/mail EPs#380
xabg2 merged 5 commits intomasterfrom
feature/mail

Conversation

@xabg2
Copy link
Contributor

@xabg2 xabg2 commented Mar 25, 2026

Adding Mail's basic EPs, which are already available in our Mail API.

@xabg2 xabg2 requested a review from TamaraFinogina March 25, 2026 16:30
@xabg2 xabg2 self-assigned this Mar 25, 2026
@xabg2 xabg2 added the enhancement New feature or request label Mar 25, 2026
@xabg2 xabg2 marked this pull request as draft March 25, 2026 16:30
src/mail/api.ts Outdated
return this.client.post(`${this.apiUrl}/emails`, { email, params }, this.headers());
}

async getE2EEmails(): Promise<Email[]> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email? Shouldn't it be HybridEncryptedEmail? and different methods like for send

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function goes out. The types are the types the Mail API are returning. We can add the encryptedKey, but the types from crypto are not valid.

return this.client.delete(`${this.apiUrl}/email/${id}`, this.headers());
}

async updateEmail(id: string, body: UpdateEmailRequest): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This EP will be used to mark an email as read/flagged.

}

async saveDraft(body: DraftEmailRequest): Promise<EmailCreatedResponse> {
return this.api.saveDraft(body);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we encrypt it first? With a user mnemonic, for example, just for storing on the server?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think we should encrypt the messages here.

yarn.lock Outdated
@@ -13,12 +13,12 @@

"@babel/compat-data@^7.28.6":
version "7.29.0"
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d"
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npmjs?

* @param params - The public parameters of the email
* @returns Server response
*/
async sendE2EEmails(emails: HybridEncryptedEmail[], params: EmailPublicParameters): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabg2 It should be just sendEmail, no? Then we can add other functions that will send encrypted or password-protected emails

Copy link
Contributor Author

@xabg2 xabg2 Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the name to differentiate it from the other EPs that do not have the crypto layer )and they are not used rn in mail web). But we can change it in this PR if you want.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok, I've just thought that the next PR will add all crypto in the email, including new send methods. But at the end it will be the same

@xabg2 xabg2 marked this pull request as ready for review March 26, 2026 13:41
@xabg2 xabg2 merged commit b2bd737 into master Mar 26, 2026
@xabg2 xabg2 deleted the feature/mail branch March 26, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants