GitHubGitHub (opens in a new tab)
  • Introduction
    • Encryption
    • SSO
    • Installation
    • Next.js
    • Angular
    • React.js
    • Remix
    • Svelte
    • Vue.js
  • Usage & Pricing

    • What is Secrecy cloud ?
    • Getting started with the cloud
    • Add files and folders
    • Edit files and folders
    • Sharing files and folders
    • Get shared nodes
    • Stop sharing files and folders
    • Move files and folders to trash
    • Delete definitively files and folders
    • Delete all files and folders from the trash
    • Restore from trash
    • Move files and folders
    • What is Secrecy mail ?
    • Getting started with the mail
    • Send a mail
    • Save mail as a draft
    • Edit a draft mail
    • Send a mail to trash
    • Get mails from trash
    • Delete definitively mails
    • Delete all mails from trash
    • Restore mail from trash
    • Mark mail as read or unread
    • Get unread mails number
    • Send mails to non-registered users
    • Encrypt data anonymously
  • Authorization
  • Errors
  • Api reference

On This Page

  • Delete all mails from the trash
Question? Give us feedback → (opens in a new tab)Edit this page
Mail
Delete all mails from trash

Delete all mails from the trash

The secrecyClient.mail.emptyTrash permanently removes all mails from the trash. It does not take any parameters.

mail-trash.ts
const deleteAllMailsFromTrash = async (): Promise<boolean> => {
  // First we need to check if the secrecyClient is available
  if (!secrecyClient) {
    return false;
  }
 
  try {
    const isDeleted = await secrecyClient.mail.emptyTrash();
    return isDeleted;
  } catch (error) {
    console.error(error);
    return false;
  }
};
Delete definitively mailsRestore mail from trash

© SECRECY 2024