0

I have a page where users can create meetings which have a specific start date and time, other users can join this meetings until up to an hour before it starts.

One hour before the meeting starts i would like to send an e-mail to the participants to tell them that the meeting will take place, or that it is canceled because not enough participants have been found. So i need to filter all the existing and not yet closed/started meetings and see if any of them are less than one hour away from starting.

Question:

Whats the best practice to do this kind of data evaluation in Drupal. Is there a recommended way of doing this?

My idea:

Just create an external PHP file including all the drupal shebang, call it every x minutes with a cron job and access the DB from inside this script.

2
  • 1
    Have you looked into using rules and rules scheduler to send off the emails? Node one has a lot of tutorials on using rules to do the type of thing you're looking to do with video 15 going over how to use fields and rules scheduler to evaluate at what time to send an email Jan 24, 2014 at 19:54
  • Thanx pokermoneyclips, that is a great video, explaining exactly what i want to do and how to do it with modules instead of custom php code ! Can you put this into an answer so that i can accept it please?
    – Larzan
    Jan 25, 2014 at 11:29

1 Answer 1

1

Drupal has a custom module available called Rules with a submodule Rules Scheduler that will allow you to set up custom scenarios for when you want a certain action to take place.

In your specific scenario you would use Rules and Rules Scheduler to set up custom emails to be sent out at your specified time based off of your time field.

Node one has several tutorial videos available to watch with a specific video available about how to use content fields and rules scheduler to set up time specific actions.

1
  • Thanks, this solution is not only with less programming and more 'drupal conform' as my "just use a php script and query the db" but it is also more efficient, as the evaluation of a specific node is scheduled and no complex db query to find the nodes that will expire in x hours is necessary!!
    – Larzan
    Jan 27, 2014 at 21:43

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