(solved)how to set reminder in 30 days

mardhiah7872

New Member
hi all,


i want to set reminder by email to the user in 30 days before due date.

example :
modul_maklumat_kemasukan_projek_baru___tarikh_tamat_projek = 30/12/2020

so i want to set reminder on 1/12/2020 to the user.

anyone can help me
 
As per the Wiki link I gave you:
Condition - OPTIONAL PHP to evaluate for each row. The row will not be processed if you return false. Standard element placeholders can be used, or row data can be accessed from $row array. Remember that this code runs on every row in the list, so keep your code efficient so you don't run in to max execution time issues.
In your case, obviously it'll return true if today is equal to "due date" minus 30 days.
 
Have you turned "Test Mode" off?
yes.but when i turned off test mode 'page is not working '.but i received email as per attached.i also put condition.but the condition is not going well.
 

Attachments

  • pageisnotworking.png
    pageisnotworking.png
    9.9 KB · Views: 165
  • duedate30days.png
    duedate30days.png
    58.6 KB · Views: 164
but the condition is not going well.
Yeah, that won't work for a number of reasons.

Provided that the "due date" is stored in the DB as the usual yyyy-mm-dd hh:mm:ss, try this:
Code:
$due = strtotime('{modul_maklumat_kemasukan_projek_baru___tarikh_tamat_projek_raw}');
$now = time();
$diff = $due - $now;
return $diff > 2592000;
Please try to understand what's happening in these four lines, including the last line which will return either true or false (nothing else) as required by the plugin (see Wiki again).
 
Compare
Code:
$due = strtotime('{modul_maklumat_kemasukan_projek_baru___tarikh_tamat_projek_raw}');
$now = time();
$diff = $due - $now;
return $diff > 2592000;
with yours.

Mine will return true (= send email) if the due date is more than 30 days in the future.

Yours will return 2592000 only if the due date is exactly 2,592,000 seconds in the future, otherwise it'll return false (= no email).
 
Compare

with yours.

Mine will return true (= send email) if the due date is more than 30 days in the future.

Yours will return 2592000 only if the due date is exactly 2,592,000 seconds in the future, otherwise it'll return false (= no email).
sir,
i want to send email when due date equal 30 days.
 
Yes, but in your condition you're stating it shall be true = sent only at the exact moment (second) when "now" is precisely 2,592,000 seconds before due date. You'll have to admit that this can hardly ever be matched, unless it's guaranteed to be triggered every single second.

Code:
return $diff > 2592000;
is true if "now" is more than 30 days before due date. So, that'll work fine, and to avoid multiple mails sent, you could use "No duplicates" and a hidden field, and be relatively free with triggers.

Alternatively, you could probably make it
Code:
return $diff > 2592000 && $diff <= 2678400;
and make sure it's triggered exactly once every day.
 
I'll try sir

Refer to that article

$myDateElement = strtotime($row->date_time);
$date = new DateTime();
$datenow = $date->getTimestamp();
$datediff = ($datenow - $myDateElement);
$diff = round($datediff / 86400); //difference in days
return ($diff == 10); // To send email on 10th day. Change this value to send nth day.

just want to clarify .is it $row refer to field like {modul_maklumat_kemasukan_projek_baru___tarikh_tamat_projek_raw}.
tq for ur attention.
 
Alhamdulillah.my scheduler and email is working now. first email is true,but i want to ask the second email that i was received as per attached.
 

Attachments

  • emelgmail.png
    emelgmail.png
    22.9 KB · Views: 143
As per Wiki, if you have an address entered in the "Email to" field there under Log, you will receive that log email each time the task gets executed.
Empty that field and save the task, and those log emails should stop.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top