FlorianA Posted February 26, 2023 Share Posted February 26, 2023 Hi, I'd like to add a checkbox ("Notify users about changes") to the user profile editor and, after user has saved his profile and checked this box, send some e-mail notifications about his changes. I'm using a mechanism like that successfully for other pages by using hooks on ProcessPageEdit::buildFormContent and Pages::saved, this also works when editing any "user" page as admin, but it doesn't work when editing the user page via the "Profile" menu item. Is there any hook that can achieve that for profile editing? I've tried ProcessProfile::execute, but I couldn't find a way to get the form's raw data from there. Link to comment Share on other sites More sharing options...
RyanJ Posted May 8, 2023 Share Posted May 8, 2023 @FlorianA I know your question is a bit old, but I just recently had to do this and below is how you get the form data. In my case, I put it all in a custom module. Gets called after an update is made at /admin/profile/ public function init() { $this->pages->addHookAfter('ProcessProfile::execute', $this, 'sendOutProfileNotification'); } public function sendOutProfileNotification(HookEvent $event) { $event = $event->object; //form data is found in $data = $event->return; //do something with data here is data is not null. } Hope that helps. 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now