This seems so easy and forgive me if I missed it.

I want to email a registered user when their node is published. All content created on the site is unpublished by default. Once and admin publishes it, the user should get an email. That's it.

I have a rule set up with Event: "After updating existing content" and Condition: "Content is published," but that notifies the user when the content is published AND when it is subsequently updated after initial publishing. I only want one email to go out... when the node is first published.

Seems like there should be an Event: "After publishing unpublished content" or something like that.

Any ideas? Thanks.

Tim

Comments

mustanggb’s picture

Component: Rules Core » Rules Engine

What about adding a Condition that is a Data comparison of node:status to node-unchanged:status

trgreen17’s picture

Thanks for the suggestion! I will read the documentation to find out how those tags work. I was just wondering if I was missing something very obvious.

Thanks again,
Tim

mustanggb’s picture

node-unchanged is what the node entity looked like before saving
node is what the node entity looked like after saving
status is whether it is published or not

So you could say if node-unchanged:status != node:status (node is going from published to unpublished or unpublished to published) then email user

Or you could only email user when node is going from unpublished to published by checking if node-unchanged:status == false and node:status == true

trgreen17’s picture

StatusFileSize
new64.21 KB

That certainly sounds like it should work but I'm not having any luck. It's not sending the email at all now. I have attached a screenshot of my rule. Can you tell me what I did wrong? Thanks!

Tim

trgreen17’s picture

Status: Active » Closed (works as designed)

I figured it out. I set a condition "content is published" AND "node-unchanged:status != node:status" like you suggested before. But since it only works if the content is published, it only sends the email when it goes from unpublished to published.

Thanks so much for your help, akamustang!

Tim

mustanggb’s picture

Status: Closed (works as designed) » Closed (fixed)

Glad you sorted it out

patoh’s picture

How did you manage to put the not equal to operator.. I cant seem to find that operator.

varunity’s picture

Component: Rules Engine » Rules Core

@patoh use the "Negate" checkbox at the end of the form when editing your condition (with equals set as the Operator).

clarions’s picture

clarions’s picture

can someone please help me here, I can't figure out how to send a particular user an email when a particular content type has been published;, also I am using the revisions module as well.

joshuautley’s picture

How did you obtain the following token... [node:author:mail] ?

norio’s picture

I'd also like to know how you got [node:author:mail]

norio’s picture

@joshuautley: Click: Switch to data selection and then use that :)

joshuautley’s picture

Install Entity token then you'll have access to the token.

joshuautley’s picture

And, yes switch to data selection