Notice: ABPro's Stripe payment processor uses the Legacy Checkout and is not SCA compatible. read more..

How-To

cron Reminder to Resource


The cron reminder code only sends a reminder to the customer.

This How-To shows a modification to also send the reminder to the resource also.

 

Edit file: \modules\mod_sv_reminders\reminders_cron.php

 

Modify the query, at line 137, to fetch the resource email address, add the red code.

$sql = "SELECT ".$request_table.".*, DATE_FORMAT(".$request_table.".startdate, '%W %M %e, %Y') as display_startdate, ".
  "DATE_FORMAT(".$request_table.".starttime, ' %l:%i %p') as display_starttime ,".
  $resource_table.".name AS resource_name ,".$resource_table.".resource_email ".
  "FROM (".$request_table." INNER JOIN ".$resource_table." ".
  " ON ".$request_table.".resource = ".$resource_table.".".$resource_id." )".
  " WHERE ".$request_table.".".$request_id." IN (".
  " SELECT ".$request_id." FROM ".$request_table." WHERE request_status = 'accepted' ".
  " AND DATE_ADD(CURDATE(),INTERVAL ".intval($days)." DAY) = startdate)";

 

Now, add code to send the reminder to the resource_email if it has been entered..

At line 185 add red code..

} else {
  if(sendMail($request->email, $subject, "reminder", $request->$request_id)){
      $line = "Recipient: ". $request->email . ", ".stripslashes($request->name). ", ".stripslashes($request->resource_name).",     ".$request->display_starttime. ", ".$request->display_startdate." - Ok";
      logReminder($line, $request->$request_id, $request->user_id, $request->name, $offsetdate-        >format($reminder_log_time_format, true, true));
      $status .= $line."<br>";
  } else {
      $line = "Recipient: ". $request->email . ", ".stripslashes($request->name). ", ".stripslashes($request->resource_name).",     ".$request->display_starttime. ", ".$request->display_startdate." - Failed";
      logReminder($line, $request->$request_id, $request->user_id, $request->name, $offsetdate-  >format($reminder_log_time_format, true, true));
      $status .= $line."<br>";
  }
  if($request->resource_email != ""){
      sendMail($request->resource_email, $subject, "reminder", $request->$request_id);
  }
}