[Vtigercrm-developers] Workflow for sending mail in the future

Estefan Civera estefan.civera at gmail.com
Fri Apr 8 06:30:54 GMT 2016


Hi All,

I need to develop a system that allows me to send programmatly email after
planning them.

Here's an example 
today I create an event in which I plan to send an email from 5 days at
18:30
I would that automatically 5 days at 18:30 through a workflow seemed this
email.

So I created a workflow that runs hourly and that checks if the start
datetime of event is between (NOW()-$value HOURS and NOW())

To do this  I've used "less than hours before" function that runs like this
code below

$rawFieldValue = date time of events....
$value = 1 // hours to go in the past

case 'less than hours before':
if(empty($rawFieldValue) || empty($value)) {
	return false;
}
$currentTime = date('Y-m-d H:i:s');
$olderDateTime = date('Y-m-d H:i:s', strtotime('-'.$value.' hours'));
if($olderDateTime <= $rawFieldValue && $rawFieldValue <= $currentTime) {
	return true;
}
return false;

I don't know this workflow never fires and the other works correctly.

Thank EC



-----
Ing. Estefan Civera
Vtiger developer and consultant
http://www.estefancivera.net
Italy
--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Workflow-for-sending-mail-in-the-future-tp18763.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.


More information about the vtigercrm-developers mailing list