Hi everyone! I’m integrating Webhook into my Ghost. This webhook is connected to the workflow in n8n and listens to the Member Updated event.
I noticed that each time a member changes name or email in Ghost, I get this JSON:
[
{
"body": {
"member": {
"current": {
"id": "123",
"uuid": "123",
"email": "bob@example.com",
"name": "Bob",
"note": null,
"subscribed": false,
"created_at": "2023-06-04T14:25:16.000Z",
"updated_at": "2024-06-04T14:27:31.000Z",
"subscriptions": [
],
"status": "paid",
"tiers":
[
{
"id": "321",
"name": "Test",
"slug": "test-2",
"active": true,
"welcome_page_url": null,
"visibility": "public",
"trial_days": 0,
"description": "....",
"type": "paid",
....
}
],
....
"previous": {
"updated_at": "2024-06-04T14:26:25.000Z",
"name": "Bill"
}
}
},
"webhookUrl": "webhook_url",
"executionMode": "production"
}
]
As you can see, there is a key called ‘previous’, which should show the changes, which have been made in this request.
The thing is that when a member updates his tier, these changes don’t show in the ‘previous’ key.
For example, if a user changes tier from ‘Test’ to ‘Test1’, I expect the ‘previous’ value to be like:
[
{
"body": {
...
"previous": {
"updated_at": "2024-06-04T14:26:25.000Z",
"tiers":
[
{
"name": "Test",
}
]
}
...
}
]
But instead of this, I’m getting an empty value for ‘previous’.
Can someone, please, explain to me, how it works? Perhaps, there are some alternatives, or should I use a different event for Webhook?