Search.../

onMemberUpdated( )

An event that is triggered when a site member's information is updated.

Description

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.

Syntax

function onMemberUpdated(event: UpdatedMemberEvent): void

onMemberUpdated Parameters

NAME
TYPE
DESCRIPTION
event
UpdatedMemberEvent

Information about the site member whose information was updated.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event that occurs when a site member's information is updated

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3// Add the file if it doesn't exist.
4
5export function wixMembers_onMemberUpdated(event) {
6 const memberUpdateDate = event.entity._updatedDate;
7 const updateEventId = event.metadata.id;
8}
9
10/* Full event object:
11 *{
12 * "metadata": {
13 * "id": "b91e0e4e-1869-4705-ae8c-70b456b2ceed",
14 * "entityId": "583b58eb-708e-4eba-bb8d-af7f9914721b",
15 * "eventTime": "2021-12-10T15:00:29.236054Z",
16 * "triggeredByAnonymizeRequest": false
17 * },
18 * "entity": {
19 * "loginEmail": "john@example.com",
20 * "privacyStatus": "PUBLIC",
21 * "_id": "583b58eb-708e-4eba-bb8d-af7f9914721b",
22 * "_createdDate": "2021-12-10T10:44:37.000Z",
23 * "_updatedDate": "2021-12-10T10:44:36.939Z",
24 * "activityStatus": "ACTIVE",
25 * "profile": {
26 * "profilePhoto": {
27 * "_id": "a27d24_0dd318%7Emv2.jpg",
28 * "url": "http://static.wixstatic.com/media/a27d24_0dd318%7Emv2.jpg",
29 * "height": 0,
30 * "width": 0
31 * },
32 * "slug": "john40355",
33 * "coverPhoto": {
34 * "_id": "",
35 * "url": "https://example.com/myimage.jpg",
36 * "height": 0,
37 * "width": 0
38 * },
39 * "title": "Awesome title",
40 * "nickname": "John Doe"
41 * },
42 * "status": "APPROVED",
43 * "contactId": "583b58eb-708e-4eba-bb8d-af7f9914721b",
44 * "contactDetails": {
45 * "customFields": {
46 * "custom.pet-name": {
47 * "name": "Pet Name",
48 * "value": "Bob"
49 * }
50 * },
51 * "company": "Wix",
52 * "phones": [],
53 * "lastName": "Doe",
54 * "firstName": "John",
55 * "birthdate": "2000-01-01",
56 * "jobTitle": "Developer",
57 * "emails": [
58 * "john@example.com"
59 * ],
60 * "addresses": [
61 * {
62 * "city": "Jewell",
63 * "addressLine": "10 Cedarstone Drive",
64 * "_id": "156e50e8-8127-4617-a052-da66bb9a96a0",
65 * "country": "US",
66 * "postalCode": "43530",
67 * "subdivision": "US-OH"
68 * }
69 * ]
70 * }
71 * }
72 *}
73 */