onContactDeleted( )


Triggered when a contact is deleted.

If a contact is deleted as part of a merge, the originatedFrom property is sent as merge. Otherwise, originatedFrom isn't returned.

Method Declaration
Copy
function wixCrm_onContactDeleted(event: ContactDeleted): void;
Method Parameters
eventContactDeleted

Metadata for the event.

An event fired when a contact is deleted
JavaScript
// Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixCrm_onContactDeleted(event) { const contactId = event.metadata.entityId; console.log("Contact deleted", event); } /* Full event object: * { * "metadata": { * "id": "e252a78d-bd95-4aa2-b65f-91730da186fa", * "entityId": "custom.customer-group-3", * "eventTime": "2024-01-11T12:47:31.862945419Z", * "triggeredByAnonymizeRequest": false * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?