Drupal Association members fund grants that make connections all over the world.
Rules Scheduler allows you to schedule the execution of a Component. While you can map the date of execution to a field, there's no way to calculate a date and pass it to the scheduler, but you can do this programatically.
Before using the code below, you will need to set up a Component in the Rules UI. You may need to set up parameters for the component if you want it to operate on an entity. For example you might set up a parameter named 'user_to_delete' of type User to pass to an action for blocking a user.
To schedule the execution of a component:
$component = 'machine_name_of_the_component'; $task_identifier = 'a_unique_task_identifier'; rules_action('schedule', array('component' => $component))->executeByArgs(array( 'date' => $timestamp, 'identifier' => $task_identifier, // Add component parameters, prefixed with 'param_' 'param_x' => $x, 'param_y' => $y, ));
Deleting a scheduled rule component
rules_action('schedule_delete', array('component' => $component))->executeByArgs(array( 'task' => $task_identifier, ));