up vote 2 down vote favorite
share [g+] share [fb]

How can I leverage Rules to look for nodes where a CCK field has a specific value, and when found, email those node authors? For example, if I wanted people to login and update their profile when I add a new CCK field, how would I do that?

link|improve this question

feedback

5 Answers

up vote 1 down vote accepted

If you want to use rules for that, you would have to create your own event: when you add a CCK field. You would then have to write some code to trigger then event when a new CCK field is added, and supply rules with the nodes of that type or whatever data you would need in your rule.

My guess is that the amount of custom coding needed for this to work, would be more than what is needed to just do this yourself in a custom module, with hook_mail. Also you might have problems configuring the rule to do what you need. I haven't tried using an array of data types in rules, so that might make things more complicated for you as well.

link|improve this answer
feedback

Take a look at this module I made - it almost does what you want, so following on from @googletorp's comment about using hook_mail, this might give you a head start towards your own module:

http://drupal.org/project/content_access_mail

link|improve this answer
feedback

Just another bit of input here: http://www.midwesternmac.com/blogs/jeff-geerling/sending-thousands-automated-sc

I had to build a system that was much more scalable than directly shooting off hundreds or thousands of emails through Rules. Instead of doing it that way (and risking overutilizing server resources when new emails were sent), I installed the SimpleNews module, and used a few of its hooks via Rules to schedule an email that will be sent in batches on cron runs.

Of course, once you get to the scale of hundreds or thousands of emails, you might start considering using an external resource such as Amazon SES. I'm guessing you're not quite to that level :-)

link|improve this answer
feedback

An article I just wrote about combining Rules and the Queue API, for Drupal 7 is the following: Using Rules and the Queue API to batch send mass mails.

link|improve this answer
feedback

You might be able to accomplish this using Rules and Views Bulk Operations. The following screencast might get you started: NodeOne talks Drupal: Rules + VBO, revisited!

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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