Skip to main content
Bounty Ended with 100 reputation awarded by Nigel Waters
readibility
Source Link
Gregory Kapustin
  • 2.2k
  • 1
  • 15
  • 26

CreateIt has to be triggered when a new rule with theparticular role event "("subscriber") has been removed. So we can use 2 conditions After updating an existing user accountUser has role(s)".

With PHP, we'llto check if the userhe had more role(s) before than after his account's been edited with the condition "Use PhP code". We'll comparerole "unchanged"before the edit user's role with the ", and that he doesn't have it updatedafter the edit" user's role like this :

if(count($account->roles) < count($account_unchanged->roles)) {return TRUE;}

Then in your actions1st condition : selector "account_unchanged", send your mail.check the role "subscriber" (here test)

PS: if you don't find the "use php code"2nd condition type, be sure "php filter" is enabled in your modules: selector "account", incheck the core sectionsame role, and (no module installation needed)negate.

Have fun !enter image description here

Create a new rule with the event "After updating an existing user account".

With PHP, we'll check if the user had more role(s) before than after his account's been edited with the condition "Use PhP code". We'll compare "unchanged" user's role with the "updated" user's role like this :

if(count($account->roles) < count($account_unchanged->roles)) {return TRUE;}

Then in your actions, send your mail.

PS: if you don't find the "use php code" condition type, be sure "php filter" is enabled in your modules, in the core section (no module installation needed).

Have fun !

It has to be triggered when a particular role ("subscriber") has been removed. So we can use 2 conditions User has role(s), to check if he had the role before the edit, and that he doesn't have it after the edit :

1st condition : selector "account_unchanged", check the role "subscriber" (here test)

2nd condition : selector "account", check the same role, and negate.

enter image description here

added 33 characters in body
Source Link
Gregory Kapustin
  • 2.2k
  • 1
  • 15
  • 26

Create a new rule with the eventevent "After updating an existing user account").

With PHP, we'll check if the user had more role(s) before than after his account's been edited: with the "Usecondition "Use PhP code", and. We'll compare "unchanged" user's role with the "updated" user's role withlike this :

if(count($account->roles) < count($account_unchanged->roles)) {return TRUE;}

Then in your actions, send your mail.

PS: if you don't find the "use php code" condition type, be sure "php filter" is enabled in your modules, in the core section (no module installation needed).

Have fun !

Create a new rule with the event "After updating an existing user account").

With PHP, we'll check if the user had more role(s) before than after his account's been edited: "Use PhP code", and compare "unchanged" user's role with the "updated" user's role with:

if(count($account->roles) < count($account_unchanged->roles)) {return TRUE;}

Then in your actions, send your mail.

PS: if you don't find the "use php code" condition type, be sure "php filter" is enabled in your modules, in the core section (no module installation needed).

Have fun !

Create a new rule with the event "After updating an existing user account".

With PHP, we'll check if the user had more role(s) before than after his account's been edited with the condition "Use PhP code". We'll compare "unchanged" user's role with the "updated" user's role like this :

if(count($account->roles) < count($account_unchanged->roles)) {return TRUE;}

Then in your actions, send your mail.

PS: if you don't find the "use php code" condition type, be sure "php filter" is enabled in your modules, in the core section (no module installation needed).

Have fun !

Source Link
Gregory Kapustin
  • 2.2k
  • 1
  • 15
  • 26

Create a new rule with the event "After updating an existing user account").

With PHP, we'll check if the user had more role(s) before than after his account's been edited: "Use PhP code", and compare "unchanged" user's role with the "updated" user's role with:

if(count($account->roles) < count($account_unchanged->roles)) {return TRUE;}

Then in your actions, send your mail.

PS: if you don't find the "use php code" condition type, be sure "php filter" is enabled in your modules, in the core section (no module installation needed).

Have fun !