Edit: Okay, re-read the question and I totally missed the point. Removed all the stuff about e-mail processing.
Step #1: Create a hidden field "processed" which can be used to make sure it only gets processed once
Step #2: create a condition, Execute PHP code:
<?php
// Load the webform by its Node ID
$webform = node_load(123);
// Load the webform's submissions by the Node ID
module_load_include('inc', 'webform', 'includes/webform.submissions');
$submissions = webform_get_submissions(123);
// The submission array uses component ids,
// so search through the webform and reference component ids by their field name
foreach($webform->webform['components'] as $component_id => $component)
{
if ($component['form_key'] == 'processed')
{
$processed_comp_id = $component_id;
}
elseif ($component['form_key'] == 'date')
{
$date_comp_id = $component_id;
}
elseif ($component['form_key'] == 'time')
{
$time_comp_id = $component_id;
}
}
// Check all submissions and see if any need to be processed
foreach($submissions as $submission)
{
// First check if the submission has already been processed
if (isset($submission->data[$processed_comp_id]) &&
empty($submission->data[$processed_comp_id]['value'][0]))
{
// Check the Scheduled Release time
if (isset($submission->data[$date_comp_id]) && isset($submission->data[$time_comp_id]))
{
if (!empty($submission->data[$date_comp_id]['value'][0]) ||
!empty($submission->data[$time_comp_id]['value'][0]))
{
$now = date("U"); // Current UNIX timestamp
// Check if the current time is still prior to the scheduled time
if($now < strtotime($submission->data[$date_comp_id]['value'][0]." ".
$submission->data[$time_comp_id]['value'][0]))
{
// If it is, continue on to the next submission
continue;
}
}
}
// Set the submission to successfully sent, and then update it
$submission->data[$processed_comp_id]['value'][0] = 1;
// If it couldn't be updated, change e-mail settings to notify of the error
if (!webform_submission_update($webform, $submission))
{
$email_to = "[email protected]";
$email_subject = "Error processing scheduled webform rule";
$email_message = print_r($submission,true);
}
// Return True so that it passes the condition
return true;
}
}
?>