Posted: December 19, 2013 at 2:47 pm
|
Hi, I’ve been trying to do what it was discussed on a topic created by Stian Morsund https://eventespresso.com/topic/add-profile-information-from-registration-page/ Unfortunately, I have not been able to make it work. I have couple issues, first I’m also using the code from https://gist.github.com/sethshoultes/5574217 to create an user and it works but the admin is not receiving the notification email that one normally gets when a new user is created. And second, I’m trying to follow the instructions to update user meta but I’m getting coding error. Please help, thanks! |
Hi Cedar, If you can post the code, or upload somewhere for us to view we can guide you a little better. In effect the simplest method is to wrap each field within the update_user_meta() function from the post linked. Like this for example from line 27: update_user_meta($user_id, 'event_espresso_address’, $attendee_data['address']) update_user_meta($user_id, 'event_espresso_address2’, $attendee_data['address2']) Edit – altered code |
|
|
Hi Tony, thanks for your quick reply. This is what I have and is not working. /** // Generate the password and create the user // Set the users details // Set the role //Update User Meta // Email the user } // end if Please let me know what am I doing wrong, thanks! |
|
I thought I remembered working on this before. Try this code: |
|
Hi Sidney, thanks a lot that worked, amazing support! One last thing and I’m done with this, normally when one creates a user in wordpress the admin receives an email too. Is there a way to include that in the code? Thanks again! |
Hi, Think WP would send that out automatically. You could probably another wp_mail line that has the site admin info in it. Hope that helps. |
|
|
Hi Seth, yes normally WP send a notification automatically but it’s not doing it when the user is created using EE forms. I’ll try adding another email line. Thanks! |
You could try using the wp_new_user_notification() function. http://codex.wordpress.org/Function_Reference/wp_new_user_notification You would need to modify the code and remove the current wp_mail call otherwise the user will receive two confirmation emails. |
|
The support post ‘Update User Meta’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.