Community Support Forums — WordPress® ( Users Helping Users ) — 2012-02-03T14:14:23-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=17136 2012-02-03T14:14:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17136&p=62284#p62284 <![CDATA[Re: Email sent on member import]]>
I didn't suspect that function because its always been in the functions.php and I've run the import procedure before without it triggering emails!

I'll just keep my eye on it on future projects and report back if it happens again :)

Thanks!

Zoe

Statistics: Posted by epixmedia — February 3rd, 2012, 2:14 pm


]]>
2012-02-03T12:24:08-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17136&p=62274#p62274 <![CDATA[Re: Email sent on member import]]>
I'm guessing that the import routine triggers set_user_role and as a result, that function is being triggered.

Can you temporarily comment out the add_action line below that function when doing the import and see if that fixes it?

Statistics: Posted by Raam Dev — February 3rd, 2012, 12:24 pm


]]>
2012-02-03T03:45:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17136&p=62239#p62239 <![CDATA[Re: Email sent on member import]]>
function user_role_update( $user_id, $new_role ) {
$site_url = get_bloginfo('wpurl');
$user_info = get_userdata( $user_id );
$to = $user_info->user_email;
$subject = "Account Approval: ".$site_url."";
$message = "Hello " .$user_info->display_name . ", Your account has now been approved on ".$site_url;
wp_mail($to, $subject, $message);
}
add_action( 'set_user_role', 'user_role_update', 10, 2);

Statistics: Posted by epixmedia — February 3rd, 2012, 3:45 am


]]>
2012-02-02T18:55:05-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17136&p=62199#p62199 <![CDATA[Re: Email sent on member import]]>
Can you share the entire code for the user_role_update() function that you're using?

Statistics: Posted by Raam Dev — February 2nd, 2012, 6:55 pm


]]>
2012-02-02T08:26:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17136&p=62145#p62145 <![CDATA[Email sent on member import]]>
My client is this morning reporting members saying they have received the email "your membership has been approved". I thought the import routine acted silently? I do have the function user_role_update( $user_id, $new_role ) in my functions.php but this should only be triggered when a user role is updated, the user roles where imported as s2member level 1 and not changed...

Any advice on what might have caused this would be gratefully appreciated.

Thanks,

Zoe

Statistics: Posted by epixmedia — February 2nd, 2012, 8:26 am


]]>