We are using Magento CLI 2.4.6-p5.
We followed the steps on this page https://developer.adobe.com/commerce/extensibility/events/configure-commerce/ to set up I/O Events. We subscribed and registered both observer.customer_register_success and observer.customer_save_commit_after events. observer.customer_save_commit_after is working fine, but observer.customer_register_success events has null for the customer object. Here is the paylaod:
{
"data": {
"key": "xxx",
"value": {},
"source": "xxx",
"_metadata": {
"commerceEdition": "Adobe Commerce",
"commerceVersion": "2.4.6-p5",
"eventsClientVersion": "1.7.0",
"storeId": "1",
"websiteId": "1",
"storeGroupId": "1"
}
},
"id": "xxx",
"source": "xx",
"specversion": "1.0",
"type": "com.adobe.commerce.observer.customer_register_success",
"datacontenttype": "application/json",
"time": "2024-06-02T07:47:04.256Z",
"event_id": "xxx",
"recipient_client_id": "xxx"
}
We have the ie_events.xml in app/etc
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module-commerce-events-client/etc/io_events.xsd">
<event name="observer.customer_register_success">
<fields>
<field name="entity_id" />
</fields>
</event>
<event name="observer.customer_save_commit_after">
<fields>
<field name="entity_id" />
</fields>
</event>
</config>
Hey Sir,
Can you please tell me about below post?
https://developer.adobe.com/commerce/extensibility/events/configure-commerce/
I am little bit confused.
Thanks
Hi Sir,
I came across this link that someone mentioned earlier:
https://developer.adobe.com/commerce/extensibility/events/configure-commerce/
I'm still a bit unclear on how the event configuration works could you please help explain it? Thanks!
@deagojonso9cb7 wrote:Hi Sir,
I came across this link that someone mentioned earlier:
https://developer.adobe.com/commerce/extensibility/events/configure-commerce/I'm still a bit unclear on how the event configuration works could you please help explain it? Thanks!
In which step are you getting confused? Tell me and i'll clear that step.
Refer to the official documentation to subscribe to the events.
It appears this issue may occur when subscribing to a non-existent attribute for an entity.
Problem solved? Click Kudos and "Accept as Solution".
It’s a known case that observer.customer_register_success may emit a null customer object in Magento Cloud. In practice, observer.customer_save_commit_after works more reliably since it always carries the entity data. You can check the official Adobe docs here:
https://developer.adobe.com/commerce/extensibility/events/configure-commerce/
https://github.com/adobe/commerce-integration-starter-kit/blob/main/README.md#subscribe-to-events-in
Also, double-check your io_events.xml fields — subscribing to non-existent attributes can cause null payloads.
@Raj_Rupak wrote:
Refer to the official documentation to subscribe to the events.
https://github.com/adobe/commerce-integration-starter-kit/blob/main/README.md#subscribe-to-events-in...e
It appears this issue may occur when subscribing to a non-existent attribute for an entity.
Problem solved? Click Kudos and "Accept as Solution".
Yes. Thank you for the link.