• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

(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