Help with a list of conditions

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
johnatasJMO's picture

My rule is that when a user is updated, the email domain must contain @domain1.com, @domain2.com, etc in order to become upgraded from Provider to GoldProvider. I've been trying to use the function AND without success. Can somebody tell me where and how do I need to add the additional domains?

thanks,


{ "rules_provider_upgrade_to_gold" : {
"LABEL" : "Provider upgrade to Gold Provider role after update",
"PLUGIN" : "reaction rule",
"REQUIRES" : [ "rules" ],
"ON" : [ "user_update" ],
"IF" : [
{ "user_has_role" : { "account" : [ "account" ], "roles" : { "value" : { "4" : "4" } } } },
{ "AND" : [] },
{ "data_is" : {
"data" : [ "account:mail" ],
"op" : "contains",
"value" : "domain1.com"
}
}
],
"DO" : [
{ "user_add_role" : { "account" : [ "account" ], "roles" : { "value" : { "6" : "6" } } } }
]
}
}


Comments

^

Ayesh's picture

You will need to popup a new variable(there is an action for that) and run an explode command to user's email address to get the domain of the user first. Then you can use any condition to check domain or anything else.

You will have to create new Rule set with A User and Text stribg as arguments. In other words, once the Rule's Ctions are executed, you can't run conditions again in the same Rule.
See Nodeone.se's Rules tutorial to get it explained. However it doeen't have any video about creating new variables.

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week