Notifications Settings

Hi
Please, What is the difference in setting globals and/or Batch Communication Tool.

Globals:

Communication Tools:

Thank You.
Regards.
Luis.

Batch is not the only way notifications are used. Use whichever is being used by cron script.

Thanks for replying @sjpadgett , but the cron script uses both, and I’m not sure if it’s the right thing to do.

$CRON_TIME = $vectNotificationSettings['Send_Email_Before_Hours']; // Send_Email_Before_Hours = 150 (of notification_settings table).
$check_date = date("Y-m-d", mktime(date("h") + $EMAIL_NOTIFICATION_HOUR, 0, 0, date("m"), date("d"), date("Y"))); // $EMAIL_NOTIFICATION_HOUR = 50 (of globals)
$app_date = $prow['pc_eventDate'] . " " . $prow['pc_startTime'];
$app_time = strtotime($app_date);
$app_time_hour = round($app_time / 3600);
$curr_total_hour = round(time() / 3600);
$remaining_app_hour = round($app_time_hour - $curr_total_hour);
$remain_hour = round($remaining_app_hour - $EMAIL_NOTIFICATION_HOUR);
if ($remain_hour >= -($CRON_TIME) &&  $remain_hour <= $CRON_TIME) {
        //set message
        $db_email_msg['message'] = cron_setmessage($prow, $db_email_msg);

This is OK?
Thank you.
Luis.

Sorry Luis, I’m not seeing where GLOBALS[’???’] is used in your screenshot. Doubtful Batchcom is used here either. I’d bet, somewhere in script the defaults are set from globals. Take a look.

re: I looked over source and it looks like Batchcom is where the defaults are being set. Which makes sense however, they may be set by other features using the notification_settings table where this script pulls from.

I only put the part of the code that does calculations with the amounts of hours. I take $EMAIL_NOTIFICATION_HOUR from globals (notifications), as well as the mail provider data (smtp server, user, password, etc…)
these are the complete scripts:

Okay. I’ll review the PR for you and see if we can’t get it merged.

I will say this. I’d leave all settings retrieved from the notification_table and globals as they were before your edits because of legacy and others in the community that may be already using this script. Although, not sure how as it seemed broken to me.

Anyway, thanks for taking this on as it was needed to be fixed up.
Push all your current or new changes and I’ll review. I’m busy just now so it won’t be until later today.

Precisely what was outdated was the global variables, in addition to the email class. Update the values ​​of globals, switch to phpMail and use the manage_track_status function to update the trackets tables. The PR is out of date (I don’t know if it updates automatically)