Change WordPress user roles and capabilities Forums How to or FAQ Notify user when role is assigned

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #3980
    [email protected]


    We have a requirement, that users should be notified when they are assigned a certain set of roles, or any role except for a certain set of role.

    Is this something supported or will be supported? ( I couldn’t find it though)
    Is there some hook that we could use to generate an email, when a role is assigned via URE?



    Hi Shweta,

    This feature is not supported, but it’s interesting/useful enough to realize in a future.

    When someone assign new role to a user via WordPress UI: add new user or edit user profile pages, WP_User::add_role() and WP_User::set_role() methods are used. These methods fire hooks:

    User Role Editor does not fire any custom action when assigns to a user new roles. It uses the same WP_User::add_role() though, so it’s possible to use ‘add_user_role’ hook also.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.