latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Notifying a user's role change by admin

Home Forums Community Forum Notifying a user's role change by admin

This topic contains 1 reply, has 2 voices. Last updated by  Cathexis Technologies 4 years, 3 months ago.

Topic Author Topic
Posted: Wednesday Mar 28th, 2012 at 2:10 pm #9354

Hi,

I’m trying to add a hook that notifies via e-mail the user when an admin modifies the user’s role.
I. E.
Admin changes manually the role of a user from s2member_level1 to s2member_level2.

I’d like to get a function to notify a user by email, so I should retrieve the information about the user’e-mail and pass it to wp mail()

Just to start from somewhere, I tried to hook the wp’s function “update_user_option” inside the s2hacks.php to send an email with some random information to myself, while updating the logged admin profile, but with no luck.

add_action("update_user_option", "my_action_hook_function");
    function my_action_hook_function($vars = array())
    {
     
	  $user = new WP_User ($vars["user_id"]);
        wp_mail ("example@whatever.com", "Subject ( " . $user->user_login . " just updated their Profile )", "Message Body goes here.");

    }

Any help would be very much appreciated !

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Thursday Sep 27th, 2012 at 4:07 pm #26728

Hi,

I’m interested in being able to implement the same function as mentioned by Enzo Topico.

Thanks

Mark

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.