0

I am working on Drupal 8.7.10 and I have installed a fresh Rules 8.x-3.0-alpha5.

Could someone help me to start a very simple rule? I am still struggling with the "new" Rules.

All I need is to send an email to a specific role when a specific field has changed.

"Rulesly" speaking, after a node has been updated, if the unchanged field value is different from the changed field value, then send an email to the manager, with a link to the updated node.

P.S. : I have also started to work with Business Rules so if someone can build this with this module, that sounds good too!

  • mmm rules is not really stable enough yet in drupal 8 you may encounter some errors – Taggart Jensen Dec 4 at 5:39
0

OK, I would then recommend Business Rules to build that kind of data comparison rule.

1- Create a first Variable "Value from Entity field" to store the original value of your field.

2- Create a second Variable "Value from Entity field" to store the current value of your field (i.e. the saved value after updating node)

3- Create an Action "Send an email"

4- Create a Condition "Variable data comparison" to compare the two variables you built in 1 and 2. Available variables are listed, use {{your_variable_name}}. Use the right operator, here I needed != (different from).

5- Inside your Condition, add the Action "Send an email" (in section "Items to execute if condition succeed")

6- Create a Rule based on an event "After updating Entity", define the context (entity type and bundle, here content and content type) and insert the Condition you built in 4. You should see a nice flowchart with your Rule label (white), then your Condition label (blue) and if YES, your Action label (green).

That's a start.

Hope this helps.

  • And how does this address "send an email to a specific role" ?? – anonymous Dec 5 at 0:58
  • It does not. As I said, that is a start and for the moment I send an email to one address. As soon as I have the rest of the solution, I will edit the answer (my guess : create a third variable with the email address of the specific role people but I need time to test and review) – Toki Dec 5 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.