1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

(solved)how to set reminder in 30 days

Discussion in 'Community' started by mardhiah7872, Dec 11, 2020.

  1. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    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
     
  2. lousyfool

    lousyfool Active Member

    Level: Community
  3. mardhiah7872

    mardhiah7872 New Member

    Level: Community
  4. lousyfool

    lousyfool Active Member

    Level: Community
    Really? I doubt that -- unless you're running a very old site which you haven't updated in a looong time... ;)
     
  5. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    fabrik 3.9.2
    i don't know how to put the condition tu put 30 days before due date.
     
  6. lousyfool

    lousyfool Active Member

    Level: Community
    As per the Wiki link I gave you:
    In your case, obviously it'll return true if today is equal to "due date" minus 30 days.
     
  7. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    i run my scheduler but email that i received as per attached. i emelscheduler.png
     

    Attached Files:

  8. lousyfool

    lousyfool Active Member

    Level: Community
    Have you turned "Test Mode" off?
     
  9. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    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.
     

    Attached Files:

  10. lousyfool

    lousyfool Active Member

    Level: Community
    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 (Text):

    $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).
     
  11. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    upload_2021-1-14_16-24-21.png

    i put condition as above.still not working.anyone can help.
     
  12. lousyfool

    lousyfool Active Member

    Level: Community
    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).
     
  13. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    sir,
    i want to send email when due date equal 30 days.
     
  14. lousyfool

    lousyfool Active Member

    Level: Community
    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 (Text):
    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 (Text):
    return $diff > 2592000 && $diff <= 2678400;
    and make sure it's triggered exactly once every day.
     
  15. sunnyjey

    sunnyjey Active Member

    Level: Community
  16. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    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.
     
  17. mardhiah7872

    mardhiah7872 New Member

    Level: Community
    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.
     

    Attached Files:

  18. lousyfool

    lousyfool Active Member

    Level: Community
  19. mardhiah7872

    mardhiah7872 New Member

    Level: Community

    Attached Files:

    • log.png
      log.png
      File size:
      5 KB
      Views:
      10
  20. lousyfool

    lousyfool Active Member

    Level: Community
    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.
     

Share This Page