Community

Scheduler / Automatic control of value 5 days before custom date

I am wokring on page with courses, where users can sign up to each course if they have enough money in their profile.

Todays task is, that I need to create some rule (or any different way) where Drupal runs automatic check to find out, if there is enough users signed up in the course. This rule shoud be run 5 days before course starts and send email to users if course has been cancelled and return credit to all of them.

On creating course there is a field with number of minimum users, price for course, and the date when course is starting.