Setting up new variables to be used as schedule date

Events happening in the community are now at Drupal community events on www.drupal.org.
leon kessler's picture

I've just started developing with Rules, loving everything about it so far, but stuck on a problem and need to know what I'm doing wrong.

So my task is to schedule a rule so that an email is sent out to a user after a certain amount time from when they opened their account.

To do this I've created a rule triggered by the user account being setup, and an action on that rule which schedules a rule set. This rule set has a rule which sends out the email.

The problem then is determining the time for the schedule action to occur. As this varies depending on some options the user selected when opening the account, and also needs to be a configurable by whoever is setting up the rule (so they can say a percentage of that time).
So I figured the way to get this time was to setup a new action that created a new variable, holding the time. This action can then have it's own settings form for the configurable percentage.

I first setup an action that created a new date variable. However, when I go to the 'add scheduled rule set' action, it doesn't appear as an available token (so already I'm thinking this is the wrong way).
I changed my action to setup a number variable, and this does appear as a token.

So in my action function (that creates the new number variable), I simply return an array like this

<?php
array('date' => 123456789);
?>

However, when the rule is triggered I get an error message: Fatal error: Call to a member function is_savable() on a non-object in site_name/sites/all/modules/rules/rules/rules.variables.inc on line 354
So I'm guessing I am setting up the new variable incorrectly. But also wondering if I'm going about this the right way at all.

Any help much appreciated.
Thanks

Comments

Exactly my problem

Pooortrait's picture

i was hoping, that a new date would sent to the rule set...
second problem - i do have 2 running rule sets??? i needed to adress the new date, if it would work...

but it does not...

  • after x days the user get an email: "you need to refresh your account, or you will be delete..."
  • 2 options: he ignore, so he will be deleted OR after a trigger the rule-set-XY gets a new date variable...

... than the schedule runs for 2 weeks or something like that more...

i really need that too : (((
any solutions?

Rules

Group organizers

Group categories

Categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: