I have a function which should be executed some time later. For example, in 3 months.
I've decided to do it using Rules and Rules Scheduler. I have created a Rule which executes php-code. And I'm trying to create a task for RulesScheduler, but the problem is I don't know how to assign a parameter to the Rule in the RulesScheduler.
$state = new RulesState(); $state->addVariable('code', 'my_function("my_arg")', ); $now = new DateTime(); $task = [ 'identifier' => $now->getTimestamp(), 'date' => $now->getTimestamp()+60, 'config' => 'my_rule', 'data' => $state, ]; rules_scheduler_schedule_task($task);
New task is created but there's an error upon executing. Could you clarify me, how to assign a parameter to the rule ?