treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Include additional fields on registration form and email template?

  • Does anyone know of a way to include additional fields onto the registration form for Wordpress where those new field values could be included in the email generated when a new user is set up?

    I've tried using Theme My Login but running into issues where it doesn't appear to file the fields. I'm using the following:

    function tml_new_user_registered( $user_id ) {
    if ( isset( $_POST['user_first'] ) )
    update_user_meta( $user_id, 'user_first', $_POST['user_first'] );
    if ( isset( $_POST['user_last'] ) )
    update_user_meta( $user_id, 'user_last', $_POST['user_last'] );
    if ( isset( $_POST['user_company'] ) )
    update_user_meta( $user_id, 'user_company', $_POST['user_company'] );
    if ( isset( $_POST['user_address'] ) )
    update_user_meta( $user_id, 'user_address', $_POST['user_address'] );
    if ( isset( $_POST['user_phone'] ) )
    update_user_meta( $user_id, 'user_phone', $_POST['user_phone'] );
    if ( isset( $_POST['user_fax'] ) )
    update_user_meta( $user_id, 'user_fax', $_POST['user_fax'] );
    }
    add_action( 'tml_new_user_registered', 'tml_new_user_registered' );
    ?>
  • Nevermind. I got it working. Still some issues with the plugin which I mentioned to the developer.