php - Our round robin function is skipping sales poeple -
we have round robin system sends contact form emails numbers of sales staff in order. if there gap of period of days loses goes out of sequence. reason why happening?
code on page:
public function __construct() { parent::__construct(); // round robin - next email address $this->addrs = $this->config->item("internal_contact_emails"); // index of last email used db $last_index = $this->db->get('round_robin')->result(); $last_index = $last_index[0]->last_index; $last_index++; if ($last_index >= count($this->addrs)) { $index = 0; } else { $index = $last_index; } $this->email_to = $this->addrs[$index]; $this->db->update("round_robin", [ 'last_index' => $index ]); } sent to
$config['internal_contact_emails'] = [ 'test@gmail.com', 'test@gmail.com', 'test@gmail.com' ];
Comments
Post a Comment