feat: add 3 new plugin hooks : onBeforeBlobUpload, onBeforeDraftAutoSave, onBeforeEditDraft (#586)

Co-authored-by: Linus Rath <minipixxelinfo@gmail.com>
This commit is contained in:
Paulhenry Saux
2026-07-09 14:55:34 +02:00
committed by GitHub
co-authored by Linus Rath
parent 782974ecdb
commit 752e71198c
9 changed files with 129 additions and 17 deletions
+18
View File
@@ -674,6 +674,22 @@ export interface OutgoingEmail {
/** Free-form custom headers added by the composer or earlier handlers */
headers?: Record<string, string>;
}
/**
* Passed to onBeforeDraftAutoSave handlers as a transform value.
*/
export interface AlmostSavedDraft{
to: string[],
subject: string,
body: string,
cc?: string[],
bcc?: string[],
identityId?: string,
fromEmail?: string,
draftId?: string,
attachments?: Array<{ blobId: string; name: string; type: string; size: number; disposition?: 'attachment' | 'inline'; cid?: string }>,
fromName?: string,
htmlBody?: string
}
/**
* Passed to onBeforeReply / onBeforeReplyAll / onBeforeForward intercept hooks.
@@ -885,6 +901,8 @@ export const ALL_PERMISSIONS = [
'email:raw-send',
// Fetch a message blob's raw bytes by blobId (for decrypt/verify).
'email:blob-read',
// Upload a file to server (for encrypt).
'email:blob-write',
// Replace the rendered body of an opened email (render-takeover).
'email:render-takeover',
'calendar:read', 'calendar:write',