Support » Plugin: Participants Database » Sync WP User email with PDB?

  • I took your suggestion and am using WP Users (and your tutorial plugins) to manage access and give users easy access to their own PDB record. Is there a way to sync the PDB email field with their WP user email field?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    Yes, it’s possible with some custom code. It’s a bit complicated because there are several different ways in which the email can be changed, and each one requires a different piece of code to perform the synchronization. I’m not going to go into too much detail, but the way it works is there is an action that is triggered when a user updates their WP user profile, also if they update their Participants Database record, and then the code passes the email address on to the other place it is stored.

    So, how this needs to work really depends on the specific interactions that are possible on your site.

    From the Participants Database API, there is an action that is triggered when a user updates a Participants Database record: pdb_after_submit_update that action gets the data that was submitted in the update, so your custom code needs to take the email addres from that data and write it to the WP account for the user.

    If the user is editing their WP profile, the action that is triggered is personal_options_update and that one gets the WP user ID. You would need to get the newly-saved email value from the account and then write that value to their Participants Database record.

    I happen to be working on a plugin that does this kind of thing, it’s a couple of weeks away from release, but if your coding skills aren’t up to setting up this sync, the plugin I’m developing will handle that for you.

    Thread Starter kurtlutterman

    (@kurtlutterman)

    Thanks for that reply. I’ll wait for your new plugin. I only care about updating PDB email field and then want to write that to the WP User record so they stay in sync for Lost Password requests and login.

    In my case, I’m intentionally hiding all the WP User interaction. The enduser initially requests access with a form. I pre-populate both a PDB and WP user record for them, and then email the login info. I don’t care what’s in the WP user name/nickname/bio fields since I never use them, and the end user never sees them. But I do care about the WP user email field, since it can be used for login, and the Lost Password function. I’m just looking ahead at when one of the endusers changes their email.

    Thanks!

    Thread Starter kurtlutterman

    (@kurtlutterman)

    Is the plugin you mentioned above “Participant Database WordPress User Profile”?

    Plugin Author xnau webdesign

    (@xnau)

    Yes, it sets up the use of Participants Database as an extension to the WP user’s data.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sync WP User email with PDB?’ is closed to new replies.