Send an email X days in the future.

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

Drupal 7, Rules 2b1, Webform 3.9, Webform Rules

I have a custom implementation of Webforms that has a select field with the options having values in unix-time date value strings (ie: 1302159600). It is generating these strings from cck multi-value fields in other nodes. This part is working fine.

I would like to use that value to schedule an email to the person that filled out the form (email address is one of the fields, I can use that string fine). It is going to be a reminder email, so actually the email will be scheduled for 10 days before the date string, but I can change that by modifying the code that creates the strings.

The problem I am running into is using that value in the Rules environment. Every time I goto add a new date variable, it seems that I can't access my strings. The date variable options want me to pick a starting value with the Data Selector, instead of starting with one of my strings that I got from the form. If I had access to the form $data or one of the other variables I think I could make it work.

Is it possible to use a string to set a date variable, or am I missing something and should be using a different approach?

Comments

Figured it out.

thechanceg's picture

Nevermind, I figured out a solution. It may not be the most elegant, but it seems to be working fine. I just preprocess and store the date string as a session variable using "Execute Custom PHP Code", and then call it back in in "Schedule Component Eval" with a simple return $_SESSION['basic']['date'];

Rules

Group organizers

Group categories

Categories

Group notifications

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