I need to send an email when an admin changes a users role to role x. The email should not be sent if the users role is already role x and 'save' is pressed on the user page.
I have set up a rule:
Event: After updating an existing user account
Actions: Send mail
This works fine. Then I add a condition of type 'data comparison' account(updated user):roles with the operator 'equals' and the data value 'role x'. But for some reason the email now never sends when I change the user role to 'role x' and resave. I'm confused about why this is not working.
Then once this is fixed I assume I'll need to negate the condition that the account(unchanged user):roles equals 'role x'