<p dir="ltr">Hi</p>
<p dir="ltr">It could be the bug in scheduled workflow with conditions </p>
<p dir="ltr">Did you check <a href="https://discussions.vtiger.com/index.php?p=/discussion/174826/on-schedule-workflow-does-not-work-/p1">https://discussions.vtiger.com/index.php?p=/discussion/174826/on-schedule-workflow-does-not-work-/p1</a></p>
<p dir="ltr">Thanks <br>
Sutharsan jeganathan</p>
<div class="gmail_quote">On 8 Apr 2016 12:34 pm, "Estefan Civera" <<a href="mailto:estefan.civera@gmail.com">estefan.civera@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I need to develop a system that allows me to send programmatly email after<br>
planning them.<br>
<br>
Here's an example<br>
today I create an event in which I plan to send an email from 5 days at<br>
18:30<br>
I would that automatically 5 days at 18:30 through a workflow seemed this<br>
email.<br>
<br>
So I created a workflow that runs hourly and that checks if the start<br>
datetime of event is between (NOW()-$value HOURS and NOW())<br>
<br>
To do this  I've used "less than hours before" function that runs like this<br>
code below<br>
<br>
$rawFieldValue = date time of events....<br>
$value = 1 // hours to go in the past<br>
<br>
case 'less than hours before':<br>
if(empty($rawFieldValue) || empty($value)) {<br>
        return false;<br>
}<br>
$currentTime = date('Y-m-d H:i:s');<br>
$olderDateTime = date('Y-m-d H:i:s', strtotime('-'.$value.' hours'));<br>
if($olderDateTime <= $rawFieldValue && $rawFieldValue <= $currentTime) {<br>
        return true;<br>
}<br>
return false;<br>
<br>
I don't know this workflow never fires and the other works correctly.<br>
<br>
Thank EC<br>
<br>
<br>
<br>
-----<br>
Ing. Estefan Civera<br>
Vtiger developer and consultant<br>
<a href="http://www.estefancivera.net" rel="noreferrer" target="_blank">http://www.estefancivera.net</a><br>
Italy<br>
--<br>
View this message in context: <a href="http://vtiger-crm.2324883.n4.nabble.com/Workflow-for-sending-mail-in-the-future-tp18763.html" rel="noreferrer" target="_blank">http://vtiger-crm.2324883.n4.nabble.com/Workflow-for-sending-mail-in-the-future-tp18763.html</a><br>
Sent from the vtigercrm-developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div>