MyBB Community Forums

Full Version: Get user email from registration page.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to get the email address from someone that is signing up on the forum.

Currently, I've got few custom profile fields and I can do this to access them:
function add_fields($data) {
    global $mybb;
    //$input = $mybb->get_input('profile_fields');
    $fname = $mybb->input["profile_fields"]['fid4'];
    $lname = $mybb->input["profile_fields"]['fid5'];
    $number = $mybb->input['profile_fields']['fid8'];
    $street = $mybb->input['profile_fields']['fid9'];
    $zip = $mybb->input['profile_fields']['fid13'];
    $city = $mybb->input['profile_fields']['fid14'];

But I also want to get the email from the people signing up, how can I do this?
You can get it by hooking into datahandler_user_insert/datahandler_user_insert_end and accessing email in data/return_values