Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "http"https://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

Be aware: I'm not a RegEx expert ..., but here a few dozens of similar examples using a RegExhere a few dozens of similar examples using a RegEx ...

However, I predict you'll have multiple domains/roles to be processed. So the real Rules fun starts when this (typical) question arises: "I need to add something like a Rules Condition inside the Rules Actions, how can I do that?"

To resolve this typical question, there are basically 2 approaches (that I am aware of):

  • Use the Conditional Rules module. For an example using the Conditional Rules module (for which there is not a lot of docu available), refer to my answer to the question "http"https://drupal.stackexchange.com/questions/114955/how-to-prevent-a-node-being-saved-when-using-the-rules-module/178623#178623".
  • Rework the relevant part of your Rules Action(s) into performing a Rules Component. Because in a Rules Component, it is possible to also add Rules Conditions.

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "http://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

Be aware: I'm not a RegEx expert ..., but here a few dozens of similar examples using a RegEx ...

However, I predict you'll have multiple domains/roles to be processed. So the real Rules fun starts when this (typical) question arises: "I need to add something like a Rules Condition inside the Rules Actions, how can I do that?"

To resolve this typical question, there are basically 2 approaches (that I am aware of):

  • Use the Conditional Rules module. For an example using the Conditional Rules module (for which there is not a lot of docu available), refer to my answer to the question "http://drupal.stackexchange.com/questions/114955/how-to-prevent-a-node-being-saved-when-using-the-rules-module/178623#178623".
  • Rework the relevant part of your Rules Action(s) into performing a Rules Component. Because in a Rules Component, it is possible to also add Rules Conditions.

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "https://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

Be aware: I'm not a RegEx expert ..., but here a few dozens of similar examples using a RegEx ...

However, I predict you'll have multiple domains/roles to be processed. So the real Rules fun starts when this (typical) question arises: "I need to add something like a Rules Condition inside the Rules Actions, how can I do that?"

To resolve this typical question, there are basically 2 approaches (that I am aware of):

  • Use the Conditional Rules module. For an example using the Conditional Rules module (for which there is not a lot of docu available), refer to my answer to the question "https://drupal.stackexchange.com/questions/114955/how-to-prevent-a-node-being-saved-when-using-the-rules-module/178623#178623".
  • Rework the relevant part of your Rules Action(s) into performing a Rules Component. Because in a Rules Component, it is possible to also add Rules Conditions.
added 996 characters in body
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "http://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

DisclosureBe aware: I'm not a RegEx expert ...

PS:, but Herehere a few dozens of similar Rules examples using a RegEx ...

However, I predict you'll have multiple domains/roles to be processed. So the real Rules fun starts when this (typical) question arises: "I need to add something like a Rules Condition inside the Rules Actions, how can I do that?"

To resolve this typical question, there are basically 2 approaches (that I am aware of):

  • Use the Conditional Rules module. For an example using the Conditional Rules module (for which there is not a lot of docu available), refer to my answer to the question "http://drupal.stackexchange.com/questions/114955/how-to-prevent-a-node-being-saved-when-using-the-rules-module/178623#178623".
  • Rework the relevant part of your Rules Action(s) into performing a Rules Component. Because in a Rules Component, it is possible to also add Rules Conditions.

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "http://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

Disclosure: I'm not a RegEx expert ...

PS: Here a few dozens of similar Rules examples using a RegEx ...

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "http://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

Be aware: I'm not a RegEx expert ..., but here a few dozens of similar examples using a RegEx ...

However, I predict you'll have multiple domains/roles to be processed. So the real Rules fun starts when this (typical) question arises: "I need to add something like a Rules Condition inside the Rules Actions, how can I do that?"

To resolve this typical question, there are basically 2 approaches (that I am aware of):

  • Use the Conditional Rules module. For an example using the Conditional Rules module (for which there is not a lot of docu available), refer to my answer to the question "http://drupal.stackexchange.com/questions/114955/how-to-prevent-a-node-being-saved-when-using-the-rules-module/178623#178623".
  • Rework the relevant part of your Rules Action(s) into performing a Rules Component. Because in a Rules Component, it is possible to also add Rules Conditions.
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

Yes you could create your own (custom) Rules Condition. But in this case I don't think that's needed. The clue to what you're asking for, is a Rules Condition which is a "text comparison".

In that comparison, you use a regular expression to indicate "the email address should end with "@examplecompany.com".

For an example rule which also uses such RegEx-expressions, refer to the answer to "http://drupal.stackexchange.com/questions/195799/how-to-use-the-rules-module-to-perform-a-simple-anti-spam-validation-using-speci/195866#195866".

Disclosure: I'm not a RegEx expert ...

PS: Here a few dozens of similar Rules examples using a RegEx ...