Triggers And Actions
Submitted by learnbythedrop on Sat, 05/10/2008 - 14:24
This video explains triggers and actions which are new features in Drupal 6. Triggers and actions allow site administrators to automate tasks based on actions that occur on your Drupal site. For example, when a user adds a new comment to a node (the trigger) you can send an email (the action) to a specified address.
- learnbythedrop's blog
- 4162 reads




Comments
Hi,
When using actions and triggers on Drupal 6 I (the admin) get an email notification even when I post a comment with the admin user account, do you know how to disable this ? I don't want to be notified of my own comments.
Thanks a lot.
I know what you mean. I have not explored a method to prevent notifications of my comments from being sent.
FYI, the Triggers module has to be enabled before the "Triggers" link will show up in the Admin page... don't think that bit was in the video.
While I love the work you guys are doing, this video was very hard to watch as there is gratuitous use of panning and zooming in and out
I've gotten that feedback previously so on the newer videos there is no pan and zoom. Thanks for voicing your preference though!
Great post as usual, I really learnt a lot.
I have been playing around with Triggers and Actions since I saw your videoblog. I've used your methods as outlined here and it's helped me a lot. I've tried to take the idea of Triggers and Actions a little further but have hit a brickwall when it comes to performing a trigger based on date and time.
My scenario is like this:
1) A user creates posts an available job with an end date and time for applications.
2) The post is published.
3) Users complete a form for the position.
4) When the end date and time of the application has passed, the post is:
--- a) unpublished
--- b) an email is sent to the post creator.
I can do everything except for step 4: create a trigger based on date and time field.
I've scoured the internet for a solution can't seem to find anyone using this kind of trigger. Do you have any insights into how this can be done?
I haven't tried that before so can't speak from experience. I found a link on Drupal.org that describes how the Scheduler module can publish and un-publish nodes on specific dates. I don't know if it can be automated to pass in a date value from a form but it's worth a look if you haven't done so already. http://drupal.org/node/108984
If you can't unpublish via date you may want to try removing the post from the pages via a views filter that looks at the end date. You'd want logic in the view that goes something like this. Do not display if end date/time is less than the current date and time.
Thanks for the tutorial, nicely done.
What I want to do though is only "send an email" when certain content types are submitted, not when any content type is submitted.
I've got a few custom content types, and I want when a user enters info it sends and email to me with that information. Much like the simple Frontpage HTML form does.
And then I have another custom content type, and want when someone submits to that content it sends an email to someone else.
How would you do that?
Thanks again!
You can create your own triggers to accomplish this. Check out this article.
http://scotthadfield.ca/2008/11/30/creating-custom-triggers-drupal
Use the first three functions in your own module. He has called it "script" and it a tad confusing, but i was able to get it to work. You will need the triggerunlock module to get it to work as well. I created a custom action that fires only when a certain type of content is posted. Hope that helps.
That's a good tip, thanks.
Post new comment