Deprecated. This event will continue to work, but a newer version is available at onMemberCreated().
An event that is triggered when a site member is created.
The onMemberCreated()
event handler runs when a site member is created.
The received CreatedMemberEvent
object contains information about the site member that was created.
The site owner can configure the site to automatically approve members or require manual approval.
A member who has been approved either automatically or manually has a status of APPROVED
. A created member waiting for approval has a status
of PENDING
. A PENDING
member cannot log into the site.
Note: Backend events don’t work when previewing your site.
function onMemberCreated(event: CreatedMemberEvent): void;
Information about the member that was created.
This example uses a deprecated 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 wixMembers_onMemberCreated(event) {
const memberNickname = event.entity.profile.nickname;
const creationEventId = event.metadata.id;
}
/* Full event object:
* {
* "metadata": {
* "id": "b91e0e4e-1869-4705-ae8c-70b456b2ceed",
* "entityId": "583b58eb-708e-4eba-bb8d-af7f9914721b",
* "eventTime": "2021-12-10T15:00:29.236054Z",
* "triggeredByAnonymizeRequest": false
* },
* "entity": {
* "loginEmail": "john@example.com",
* "privacyStatus": "PUBLIC",
* "_id": "583b58eb-708e-4eba-bb8d-af7f9914721b",
* "_createdDate": "2021-12-10T10:44:37.000Z",
* "_updatedDate": "2021-12-10T10:44:36.939Z",
* "activityStatus": "ACTIVE",
* "profile": {
* "profilePhoto": {
* "_id": "a27d24_0dd318%7Emv2.jpg",
* "url": "http://static.wixstatic.com/media/a27d24_0dd318%7Emv2.jpg",
* "height": 0,
* "width": 0
* },
* "slug": "john40355",
* "coverPhoto": {
* "_id": "",
* "url": "https://example.com/myimage.jpg",
* "height": 0,
* "width": 0
* },
* "title": "Awesome title",
* "nickname": "John Doe"
* },
* "status": "APPROVED",
* "contactId": "583b58eb-708e-4eba-bb8d-af7f9914721b",
* "contactDetails": {
* "customFields": {
* "custom.pet-name": {
* "name": "Pet Name",
* "value": "Bob"
* }
* },
* "company": "Wix",
* "phones": [],
* "lastName": "Doe",
* "firstName": "John",
* "birthdate": "2000-01-01",
* "jobTitle": "Developer",
* "emails": [
* "john@example.com"
* ],
* "addresses": [
* {
* "city": "Jewell",
* "addressLine": "10 Cedarstone Drive",
* "_id": "156e50e8-8127-4617-a052-da66bb9a96a0",
* "country": "US",
* "postalCode": "43530",
* "subdivision": "US-OH"
* }
* ]
* }
* }
*}
*/
Deprecated. This event will continue to work, but a newer version is available at onMemberDeleted().
An event that is triggered when a site member is deleted.
The onMemberDeleted()
event handler runs when a site member is deleted.
The received DeletedMemberEvent
object contains information about the site member that was deleted.
Note: Backend events don’t work when previewing your site.
function onMemberDeleted(event: DeletedMemberEvent): void;
Information about the site member that was deleted.
This example uses a deprecated 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 wixMembers_onMemberDeleted(event) {
const deletionEventId = event.metadata.id;
}
/* Full event object:
* {
* "metadata": {
* "id": "6ee4c618-d1f9-4b4b-aca0-270d6984b79a",
* "entityId": "b00d7cd4-9413-4d4f-b9b1-9890f3ce27b9",
* "eventTime": "2021-12-13T09:33:13.654270Z",
* "triggeredByAnonymizeRequest": false
* }
* }
*/
Deprecated. This event will continue to work, but a newer version is available at onMemberUpdated().
An event that is triggered when a site member's information is updated.
The onMemberUpdated()
event handler runs when a site member's information is updated.
The received UpdatedMemberEvent
object contains information about the site member whose information was updated.
Note: Backend events don’t work when previewing your site.
function onMemberUpdated(event: UpdatedMemberEvent): void;
Information about the site member whose information was updated.
This example uses a deprecated 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 wixMembers_onMemberUpdated(event) {
const memberUpdateDate = event.entity._updatedDate;
const updateEventId = event.metadata.id;
}
/* Full event object:
*{
* "metadata": {
* "id": "b91e0e4e-1869-4705-ae8c-70b456b2ceed",
* "entityId": "583b58eb-708e-4eba-bb8d-af7f9914721b",
* "eventTime": "2021-12-10T15:00:29.236054Z",
* "triggeredByAnonymizeRequest": false
* },
* "entity": {
* "loginEmail": "john@example.com",
* "privacyStatus": "PUBLIC",
* "_id": "583b58eb-708e-4eba-bb8d-af7f9914721b",
* "_createdDate": "2021-12-10T10:44:37.000Z",
* "_updatedDate": "2021-12-10T10:44:36.939Z",
* "activityStatus": "ACTIVE",
* "profile": {
* "profilePhoto": {
* "_id": "a27d24_0dd318%7Emv2.jpg",
* "url": "http://static.wixstatic.com/media/a27d24_0dd318%7Emv2.jpg",
* "height": 0,
* "width": 0
* },
* "slug": "john40355",
* "coverPhoto": {
* "_id": "",
* "url": "https://example.com/myimage.jpg",
* "height": 0,
* "width": 0
* },
* "title": "Awesome title",
* "nickname": "John Doe"
* },
* "status": "APPROVED",
* "contactId": "583b58eb-708e-4eba-bb8d-af7f9914721b",
* "contactDetails": {
* "customFields": {
* "custom.pet-name": {
* "name": "Pet Name",
* "value": "Bob"
* }
* },
* "company": "Wix",
* "phones": [],
* "lastName": "Doe",
* "firstName": "John",
* "birthdate": "2000-01-01",
* "jobTitle": "Developer",
* "emails": [
* "john@example.com"
* ],
* "addresses": [
* {
* "city": "Jewell",
* "addressLine": "10 Cedarstone Drive",
* "_id": "156e50e8-8127-4617-a052-da66bb9a96a0",
* "country": "US",
* "postalCode": "43530",
* "subdivision": "US-OH"
* }
* ]
* }
* }
*}
*/