I am trying to configure a rule to send out an email notification of the changes that have been made to a node. In the replacement patterns there are tokens for updated content and unchanged content. Is there a way to also access original content?

For example, there is a field "Color", the original value is red, the user changes the value to blue and saves. I would like to send out an email notification like this:

Original color: red | Updated color: blue

Also, I only want to have tokens printed in the email if there has been a change to the field. For example, user left field "Color" unchanged, but updated field "Size" to a new value. Only the original value and updated value for "Size" would be included in the email notification. Is this possible?

Comments

tr’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

Well in your description it sounds like what you call "original content" is exactly the same as "unchanged content". I don't understand the distinction, and as far as I can tell you already have the information you need.

To display fields conditionally in your email you should use a template for your email. It's more convenient to use HTML Mail or Mime Mail in this case even if you just want plain text e-mails, because they both add a template functionality so it's easy to use your own template. Both of those modules provide a Rules action to use as an alternative to the built-in Rules "Send mail" action.