Below is a sample of a rule (in Rules export format) that will send an eMail "After updating existing content" , and which is similar to what is asked in the question:
{ "rules_notify_author_of_selected_field_updates" : {
"LABEL" : "Notify author of selected field updates",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "node_update" : [] },
"IF" : [
{ "entity_has_field" : { "entity" : [ "node" ], "field" : "field_optionlist" } },
{ "NOT data_is" : {
"data" : [ "node-unchanged:field-optionlist" ],
"value" : [ "node:field-optionlist" ]
}
}
],
"DO" : [
{ "mail" : {
"to" : "[site:current-user:mail]",
"subject" : "Notification about a node with a special field value",
"message" : "Go checkout the node with nid [node:nid] and title [node:title]: it has a field with a value (which is [node:field-optionlist]) you asked to be informed about ..."
}
}
]
}
}
Some more details to further explain the above above sample:
- In my case I have a selection list field with machine name
field_optionlist
, and a few possible values.
- The Rules Condition checks if the "The selected value changed". You may want to adapt and/or extend this condition to something like "some eMail field is not blank".
- If the Rules Condition is true, then (as Rules Action), an eMail will be triggered to the editing user.
Change the field name of field_optionlist
to match the field name of your content type, and adapt the actual eMail details (subject, etc) to fit your needs. Then import it in your own site (using the Rules UI). That's it.
PS: If you want to send such eMails to somebody who is not logged in, just change the "to" value to the eMail ID specified in your eMail field in the node. However (red flag!): I would not recommend you to allow this feature for anonymous users. Because spammers would love it: they would only have to edit such nodes, and then type any eMail Id they want to the content of your node to be spammed about ... not a good idea, right?