feat: add 3 new plugin hooks : onBeforeBlobUpload, onBeforeDraftAutoSave, onBeforeEditDraft (#586)
Co-authored-by: Linus Rath <minipixxelinfo@gmail.com>
This commit is contained in:
co-authored by
Linus Rath
parent
782974ecdb
commit
752e71198c
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user