Quantcast
Channel: Active questions tagged users - Drupal Answers
Viewing all articles
Browse latest Browse all 472

Send an email when the roles are changed

$
0
0

I'm trying to send an email to users after their role has changed. So far, the rule is triggered every time the profile is saved (even without role change); I suspect that the data comparison is not handling the array correctly?!

Any help to improve the following rule or to achieve the same feature with a different condition will be very much appreciated.

{ "rules_role_changed" : {"LABEL" : "Role changed","PLUGIN" : "reaction rule","OWNER" : "rules","REQUIRES" : [ "rules" ],"ON" : { "user_update" : [] },"IF" : [      { "NOT data_is" : { "data" : [ "account:roles" ], "value" : [ "account-unchanged:roles" ] } }    ],"DO" : [      { "mail" : {"to" : [ "account:mail" ],"subject" : "Role change for [account:name-raw]"        }      }    ]  }}

Viewing all articles
Browse latest Browse all 472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>