Welcome Guest, Not a member yet? Register   Sign In
Help with cronjob command line
#6

Thank you for all the help.

It seems to be running as if I just try to send an email with simple code it comes through, but what seems to happen atm is this code is running but its not doing anything, but I think it could be because it is not getting to the database.  Can someone take a look at this please.

PHP Code:
<?php 

class Reminders extends CI_Controller { public function __construct() { parent::__construct(); 
 
 
  
  $this
->load->library('email');
 
 $this->load->model('Appointment_model');
 
 
  
}
 
 public function run()
 
 {
 
 $timestamp strtotime("+1 days");
 
 $appointments $this->Appointment_model->get_days_appointments($timestamp);
 
 if(!empty($appointments))
 
 {
 
     foreach($appointments as $appointment)
 
     {
 
         $this->email->set_newline("\r\n");
 
         $this->email->to($appointment->email);
 
         $this->email->from("[email protected]");
 
         $this->email->subject("Appointment Reminder");
 
         $this->email->message("You have an appointment tomorrow");
 
         $this->email->send();
 
         $this->Appointment_model->mark_reminded($appointment->id);
 
     }
 
 }
 
 }

Reply


Messages In This Thread
Help with cronjob command line - by doomie22 - 07-17-2016, 08:36 AM
RE: Help with cronjob command line - by doomie22 - 07-17-2016, 09:39 AM
RE: Help with cronjob command line - by doomie22 - 07-17-2016, 10:11 AM
RE: Help with cronjob command line - by arma7x - 07-17-2016, 10:28 AM
RE: Help with cronjob command line - by doomie22 - 07-17-2016, 04:08 PM
RE: Help with cronjob command line - by PaulD - 07-17-2016, 04:17 PM
RE: Help with cronjob command line - by doomie22 - 07-17-2016, 05:37 PM
RE: Help with cronjob command line - by PaulD - 07-17-2016, 05:56 PM



Theme © iAndrew 2016 - Forum software by © MyBB