Skip to content
emailkit
Esc
navigateopen⌘Jpreview
On this page

mailbox.onDeleted

A mailbox was deleted or disconnected — clean up your records.

Fires when a mailbox is deleted through emailkit.mailboxes.delete(). Remove what you stored for it — the mailbox record and its auth.

hooks: {
  mailbox: {
    onDeleted: async ({ mailbox }) => {
      await prisma.connectedMailbox.deleteMany({
        where: { email: mailbox.email },
      });
    },
  },
},

Payload

PropType
emailDriverstring
Typestring
mailboxMailbox
TypeMailbox
context?unknown
Typeunknown

Last updated on July 24, 2026

Was this page helpful?