Skip to main content
Solved

Does the email attribute get sent to the webhook if specified during RevenueCat initialization? (React Native Expo)

  • October 24, 2024
  • 1 reply
  • 60 views

Forum|alt.badge.img

Hi everyone,

I'm currently using RevenueCat with React Native Expo and I have a question about how the email attribute is handled.

In my app, I'm initializing RevenueCat as follows:

await Purchases.configure({
  apiKey: APIKeys.apple,
});
Purchases.setEmail(userData.email);
Purchases.setDisplayName(userData.name);

I want to know if the email attribute will be sent to my webhook when a purchase event or subscription change occurs. I’m specifically setting the email after configuring RevenueCat, but I'm unsure if this will be passed to the webhook.

I didn’t see an email attribute in the body of a POST request for webhook events when I read the documentation here.

Has anyone else implemented something similar or can confirm how this works?

Thanks in advance!

Best answer by kaitlin

Hey @maulanafadilah,

Any attributes that are set will be synced with RevenueCat when Purchases.configure() is called, app backgrounded, and when purchases are made or restored. So, you may not see it in the webhook of the initial purchase after you set the email attribute, as it wasn’t synced at the time. If you’d like to sync these attributes explicitly so that they are including in webhooks right away, you can use the method `syncAttributesAndOfferingsIfNeeded`. 

Regarding the webhook response - any attributes, both fixed or custom, will be included within the `subscriber_attributes` array. The example that you linked doesn’t explicitly show the `email` attribute, but that is where it would be shown. 

View original
Did this post help you find an answer to your question?
This post has been closed for comments

1 reply

kaitlin
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 398 replies
  • Answer
  • October 28, 2024

Hey @maulanafadilah,

Any attributes that are set will be synced with RevenueCat when Purchases.configure() is called, app backgrounded, and when purchases are made or restored. So, you may not see it in the webhook of the initial purchase after you set the email attribute, as it wasn’t synced at the time. If you’d like to sync these attributes explicitly so that they are including in webhooks right away, you can use the method `syncAttributesAndOfferingsIfNeeded`. 

Regarding the webhook response - any attributes, both fixed or custom, will be included within the `subscriber_attributes` array. The example that you linked doesn’t explicitly show the `email` attribute, but that is where it would be shown. 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings