Delete an email

Your appendable data has a maximum size of 100 KiB. You can delete emails from your inbox folder by removing them from your appendable data. Your root structured data has no size limit. You can delete emails from your saved folder by removing them from your root structured data.

Contents

Inbox page

If the email was in the inbox folder

The emails in your inbox folder are stored in your appendable data. If you want to delete an email from your inbox folder, you just need to remove it from your appendable data.

Get a data identifier handle

First, the app fetches a data identifier handle for the appendable data representing your inbox folder.

data_id_handle_actions.js

The name of the appendable data is obtained by hashing your email ID:

app_utils.js

Get an appendable data handle

The app fetches an appendable data handle using the data identifier handle representing your inbox folder.

appendable_data_actions.js

Drop the data identifier handle

The app drops the data identifier handle for the appendable data representing your inbox folder.

data_id_handle_actions.js

Remove the email from the appendable data

The app removes the email you just deleted from your appendable data. This moves the email to the deleted_data field of the appendable data.

appendable_data_actions.js

Save the appendable data

The app saves your appendable data by sending a POST request to the SAFE Network.

appendable_data_actions.js

Clear the deleted data of the appendable data

The app clears the deleted_data field of your appendable data.

appendable_data_actions.js

Save the appendable data (again)

The app saves your appendable data by sending a POST request to the SAFE Network.

appendable_data_actions.js

Drop the appendable data handle

The app drops the appendable data handle and refreshes the inbox folder.

appendable_data_actions.js

If the email was in the saved folder

The emails in your saved folder are stored in your root structured data. If you want to remove an email from your saved folder, you just need to remove it from your root structured data.

When you click on the "Delete" button, the app removes the email you want to delete from your saved folder.

Get a cipher options handle

First, the app fetches a cipher options handle for symmetric encryption.

cipher-opts_actions.js

Update the root structured data

The app updates the JSON data contained in your root structured data and encrypts it using symmetric encryption. Since the email you want to delete was removed from your saved folder, this means that the new version of your root structured data won't contain that email.

structured_data_actions.js

Save the root structured data

The app saves your root structured data to the SAFE Network.

structured_data_actions.js

Drop the cipher handle

The app drops the "cipher options" handle for symmetric encryption.

cipher-opts_actions.js

Fetch the root structured data

To refresh your saved folder, the app fetches your root structured data.

structured_data_actions.js

Last updated

Was this helpful?