Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
#780340
Dear all,

I would like to know how the calculation work based on the differences of two date.

- Due date and current date.
- different (current date - due date)
- if different >3 then send mail 1
else mail 2


i want to create this in trigger.


the below is my code
Code: Select all

$from     = 'info@processmaker.com';
$to       = @@Email;
$cc		  = 'abc@gmail.com';
$subject  = 'Warning';
$subject1 = 'Reminder';
$template = 'latemail.html';
$template1 = 'remindmessage.html';



$str = strtotime(date("Y-m-d")) - (strtotime(@@followupdate));
$diff = floor($str/3600/24);


if($diff>=3)

PMFSendMessage(@@APPLICATION, $from, $to, $cc, '', $subject, $template);

else

  PMFSendMessage(@@APPLICATION, $from, $to, '', '', $subject1, $template1);



Kindly help me. Thanks
#780354
Hello
The team and i have been checking your case and we might have a suitable solution for you:
since we use PHP code in our triggers ill ask you to try the function DateTime::diff()
this function can calculate differences between dates as you wanted please follow the next URL in this URL you will get a piece of code that contains this function.

http://php.net/manual/es/function.date-diff.php

hope this solution helps you to solve your problem and let us know if you have anything else that we can assist you with

Greetings.
#780361
Adrian wrote:Hello
The team and i have been checking your case and we might have a suitable solution for you:
since we use PHP code in our triggers ill ask you to try the function DateTime::diff()
this function can calculate differences between dates as you wanted please follow the next URL in this URL you will get a piece of code that contains this function.

http://php.net/manual/es/function.date-diff.php

hope this solution helps you to solve your problem and let us know if you have anything else that we can assist you with

Greetings.

Hi Adrian,

Thanks. By the way, I find another solution. Meanwhile, this i will try too.

Use the latest verified Temu coupon $100 off ([acq[…]

To get $100 off, sign up as a new user using refer[…]

To get $100 off, sign up as a new user using refer[…]

To get $100 off, sign up as a new user using refer[…]