How to call an API after registration

janslu

Active member
What is the best way to make an API call to external service after user confirms registration in Xenforo? I have a custom field for people interested in receiving a newsletter and have an API service to call with their data (I'm sending few fields from registration). In Vbulletin I've had a simple plugin written in PHP registered in register_activate_process localization. Any hints on where to look for inspiration?
 
I'd say hooking into the user datawriter and executing additional code in the postSave() function (on inserts) would be the best bet.
 
And so the journey begins :-) Thank you!
Do you know of any primers/tutorials? I'm completely lost at the moment, and so far my searches bring more questions than answers. It is possible that I'm asking wrong questions...
 
I'd recommend looking at the XenForo Class Proxy tutorial by @Jeremy. Use it to extend the load_class_datawriter code event and extend the XenForo_DataWriter_User class. I don't know where you're at as far as php skills so it's hard to give you more direction that that.
 
Many thanks! It's much easier to know where to look for information. I'm moving a large forum from vbulletin to xenforo and there's a lot to learn. You've saved me a lot of time by giving the specific area I need to look into.
 
Back
Top Bottom