A backend event that fires when a Guest is deleted.
The onGuestDeleted()
event handler runs when a Guest is deleted from your site. The received GuestDeleted
object contains information about the deleted guest.
Note: Backend events are not fired when previewing your site.
function wixEventsGuests_onGuestDeleted(event: GuestDeleted): void;
Information about the onGuestDeleted
event.
// Place this code in the events.js file
// of your site's Backend section.
// Add the file if it doesn't exist.
export function wixEventsGuests_onGuestDeleted(event) {
const eventId = event.metadata.id;
const entityId = event.entity._id;
}
/* Full guest object:
{
"metadata": {
"id": "f9325e7a-1875-424f-8fdb-83edb03a4f7a",
"entityId": "984476a1-8a92-455a-863c-bf1efc816f7e",
"eventTime": "2023-04-19T13:23:04.892039Z",
"triggeredByAnonymizeRequest": false
}
}
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.