• Resolved emmytechs

    (@emmytechs)


    I have been having issues showing user emails to them on their account page due to some users might have multiple account and might not know which account they are on.

    This is basically not to edit the email but just to show the use that this is your email you used to signup on the website.

    Please kindly assist on this. Thanks

    • This topic was modified 9 months, 3 weeks ago by emmytechs.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author iova.mihai

    (@iovamihai)

    Hey @emmytechs,

    Thank you for reaching out! The user email cannot be shown in the affiliate account only via a code snippet.

    Here’s the snippet:

    function slicewp_custom_register_affiliate_fields_user_email( $fields ) {
    	
    	$affiliate = slicewp_get_affiliate( slicewp_get_current_affiliate_id() );
    	
    	if ( is_null( $affiliate ) ) {
    		return $fields;
    	}
    	
    	$user = get_userdata( $affiliate->get( 'user_id' ) );
    
    	$fields[] = array(
    		'type'  	  		  => 'text',
    		'id'				  => 'slicewp-user-email',
    		'name'				  => 'user_email_address',
    		'label'				  => __( 'User Email', 'slicewp' ),
    		'is_disabled'		  => true,
    		'value'				  => $user->user_email,
    		'output_conditionals' => array( 'form' => array( 'affiliate_account' ) )
    	);
    
    	return $fields;
    
    }
    add_filter( 'slicewp_register_affiliate_fields', 'slicewp_custom_register_affiliate_fields_user_email', 9 );

    Please copy the code and add it to your website. If you’re not sure how to add code snippets to your site, you can use the Code Snippets plugin (https://www.ads-software.com/plugins/code-snippets/).

    Also, please note that we do not offer customizations as part of our support. I have made an exception this time as we’ve had this snippet already built for internal use.

    Thank you and best wishes,

    Mihai

    Thread Starter emmytechs

    (@emmytechs)

    Thanks I really appreciate, It worked as expected.

    Plugin Author iova.mihai

    (@iovamihai)

    Hey @emmytechs,

    I’m happy to hear the code snippet works nicely!

    Wishing you a great weekend!

    Mihai

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Having troubles showing user email on account page’ is closed to new replies.