Reminders doesn't do nothing if selected email

I’ve created 2 reminders for 2 events in an Account, and i select to send email in one before 1 hour, and other before 5 minute. But nothing happened. No log, no error. How could i fix this?

This feature depends on two things

  • correct system outbound email account

  • correct Scheduler jobs configuration (cron jobs)

Please check if these things are correct, and if you need more help please remind me of your version of SuiteCRM, I always need that information in every thread :slight_smile:

Are other system emails sending correctly (for example, when you assign a record to a different user, not to yourself, does he get a notification?)

1 Like

[quote=“pgr” post=60484]This feature depends on two things

  • correct system outbound email account

  • correct Scheduler jobs configuration (cron jobs)
    [/quote]
    The mail are correct cause i can send the reset of the password and i recive an email when i assing a record to an another user.

The version of my suite is 7.9.11 updated 2 weeks ago

And have you set up your cron jobs?

Look in Admin / Schedulers, go into a job that should be running often (like Workflows) and check it’s “last run successfully” time.

Or check "Run Email Reminder Notifications"m, that’s the one that does what you need.

1 Like

Thanks for the reply, actually i can’t check till monday cause i dont have the access of the crm from home. So i have to check the cron job? and if there isn’t i have to make new ones?

Is normal that? last execution without errors is at 25/01/2018?

At least, you know the jobs are running. They should have a “last successful run” time of only a few minutes ago, whenever you check, since they are scheduled to run “as often as possible”.

If they are always a few hours off, I guess I know what can be wrong: maybe you didn’t set the timezone in the CLI php.ini.

There are two php.ini’s, one for the web server, one for CLI (command-line) which is what is used by the Schedulers if you’re running them from cron.

From an SSH command-line type

php -i | grep php.ini

This should tell you where that php.ini is.

You can also try

php -i | grep timezone

To see the timezone setting.

1 Like

thanks for the reply, actually i’ve cheched db level and i saw the timezone is 1 hour less then the server. The server is windows based so coul’d you give me the command for the windows cmd?

Thanks
(if you see, 10:53 and the server date is 11:53(58 by the time of the screen)

I don’t know, but it should be easy to Google it. You just need to edit your php.ini.

Those “php -i” commands should also work on Windows, just drop the grep part and look for the correct parameters in the middle of the output.

1 Like

Btw i’ve created a meeting and i’ve set the time at 15:00, so actually 14:00, then i set the reminder at 2 hour before the meeting, so 12:00, but still nothing happened, and still no log or error. I’ve tried to edit the function sendReminders and put a custom log in the if (!$mail->send()) . but still nothing happend. Seems like the cheduler is not called. I have to call it in some ways?


 foreach ($recipients as $r) {
            $mail->clearAddresses();
            $mail->addAddress($r['email'], $GLOBALS['locale']->translateCharsetMIME(trim($r['name']), 'UTF-8', $OBCharset));
            $mail->prepForOutbound();
            if (!$mail->send()) {
				file_put_contents(__DIR__."\\log\\errors",$mail->ErrorInfo."\n",FILE_APPEND);
                $GLOBALS['log']->fatal("Email Reminder: error sending e-mail (method: {$mail->Mailer}), (error: {$mail->ErrorInfo})");
            }
        }

If you set your logs at DEBUG level in Admin / System settings, you can get messages saying which Scheduler jobs are being called.

1 Like

I’ve setted at DEBUG level, but now i have already 1mb of code in suitecrm.log to check and is hard for me understand where i have to check something

Hello @GianlucaSedoc,

I may be wrong, so I’m sorry if that’s the case. For reminders to work, you need to set the date to Y-m-d.

1 Like

A question, in the reminder page it says that to run the cheduled task i have to create a batch file and run in my cron job of the server. but what is the frequence of trigger of the batch file?

To examine long logs I recommend a tool like Notepad++ where you can “find all in file” and look for the name of the job you’re interested in, and then examine what comes before and after that.

About the jobs frequency, normally (unless you’re having performance problems) you want to make the cron.php run very frequently (every minute, or every two minutes), then it decides which jobs to trigger, and when, based on the Admin / Scehduler settings. But at least for the Workflow and the Notifications jobs you probably want them to react quickly to events.

1 Like

It worked!! my problem now are 2:

  1. i need to edit the template of the reminder(i found where) but i need to know the list of the placeholders, because i want to put the name of the account in the reminder
  2. fix the problem of the time.

Great!

But… what worked? Adriano_ABC’s suggestion, or simply getting the cron jobs to run?

About the variables, see
https://github.com/salesagility/SuiteCRM/blob/master/modules/Meetings/Meeting.php#L599

or other functions with that name, inside each module for which you want notifications.

The cronjob i think doesn’t worked well with the problem of timezone, i’ve change the trigger date and hour to start, and now he sent the mail correctly