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
Comment #1
mustanggb commentedWhat about adding a Condition that is a Data comparison of node:status to node-unchanged:status
Comment #2
trgreen17 commentedThanks 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
Comment #3
mustanggb commentednode-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
Comment #4
trgreen17 commentedThat 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
Comment #5
trgreen17 commentedI 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
Comment #6
mustanggb commentedGlad you sorted it out
Comment #7
patoh commentedHow did you manage to put the not equal to operator.. I cant seem to find that operator.
Comment #8
varunity commented@patoh use the "Negate" checkbox at the end of the form when editing your condition (with equals set as the Operator).
Comment #9
clarions commentedComment #10
clarions commentedcan 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.
Comment #11
joshuautley commentedHow did you obtain the following token... [node:author:mail] ?
Comment #12
norio commentedI'd also like to know how you got [node:author:mail]
Comment #13
norio commented@joshuautley: Click: Switch to data selection and then use that :)
Comment #14
joshuautley commentedInstall Entity token then you'll have access to the token.
Comment #15
joshuautley commentedAnd, yes switch to data selection