Event Reminder

Somebody directed me to the rules module. I am using the date and calendar modules to have group specific calendars. When creating a event I want the author to be able to set a reminder to the audience of the event. So for example, a day before the event a reminder email is sent. Can I do this with the rules module, or how else can I do this?

Groups:
Login or register to post comments

I am also interested about

sp_key - Thu, 2010-08-26 11:11

I am also interested about this


Two-step solution

Itangalo's picture
Itangalo - Thu, 2010-09-02 07:59

This should be fairly easy to do with the Rules module. It becomes a littlebit trickier to select which users should get the reminder, though.

I suggest the following steps:

  1. Enable Rules, Rules UI and Rules Scheduler.
  2. Add a Date field to the event node, to allow the owner to set a reminder date.
  3. Add a rule set that sends out an e-mail. I think it should just have the event node as an argument, and to start with it is much easier to just send e-mail to the owner of the node. See details below.
  4. Add a triggered rule, triggering on node save (regardless on new/updated content). Add a condition, checking that it is an event node.
  5. As action, call the rule set in (3) with Rules Scheduler, and schedule the evaluation to the date set in the Date field.

So far so good. Now for the tricky part.
As a proof of concept, it is probably wise to start by sending only to the node owner. Use 'load user account' action to load account data, and then 'send e-mail to user' action to send information about the node.

To make the rule set send e-mail to all users who have signed up for the event, you'll either need a tailored action 'send e-mail to all signed-up users' or make use of Views to select all users who have signed up and then send e-mail to them.
If you're a programmer you can probably write a new Rules action (and submit it as a patch to Signup module, or what you're using). If not, you'll have to rely on a View that -- with the event node as argument -- displays the users that should be e-mailed. You can use it in (I think) one of three ways:

  1. Write a PHP snippet that calls the View inside a custom PHP action, and then call a suitable action programmatically with a foreach on the Views result. This is a pretty ugly hack, but it would probably be the easiest to get working. (It'll get you quite much, and quite specific PHP in the database.)
  2. You use Views Bulk Operations on the View to let the view itself send the e-mail. The tricky part here is that you (a) must have a view based on users, and (b) the only argument VBO sends along with the e-mail action is the user object -- which makes it difficult to know which event you should remind the user about. The dev version of VBO may circumvent this problem (since it has much more flexible ways of calling rule sets).
  3. You try out the Rules and Views Integration module, which is more flexible than VBO (but still in dev only).

Good luck!
//Johan Falk, NodeOne, Sweden

edit: Some more comments about this can be found on a blogpost about VBO plus Rules.

Want to make Drupal better? Answer a question or two in the forum.


Johan, many thanks for your

sp_key - Thu, 2010-09-02 08:50

Johan, many thanks for your time in responding.
This is very good info and very helpful