Пример #1
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //common variables
     $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];
     $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];
     $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];
     //specific passed variables
     foreach ($vars as $key => $value) {
         $this->data['email_vars'][$key] = $value;
     }
     //-------------send out email-------------------------------
     if ($email == 'client_invoice') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate($this->data['email_vars']['email_template']);
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         //$this->email->to($this->data['email_vars']['client_users_email']);
         $this->email->to($this->data['email_vars']['client_users_email']);
         $this->email->subject($this->data['email_vars']['email_subject']);
         $this->email->message($email_message);
         $this->email->attach($this->data['email_vars']['pdfinvoice']);
         $this->email->send();
     }
 }
Пример #2
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //common variables
     $this->data['email_vars']['clients_company_name'] = $this->input->post('clients_company_name');
     $this->data['email_vars']['client_users_full_name'] = $this->input->post('client_users_full_name');
     $this->data['email_vars']['client_users_email'] = $this->input->post('client_users_email');
     $this->data['email_vars']['client_users_password'] = $this->input->post('client_users_password');
     $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];
     $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];
     $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];
     $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'];
     //new client welcom email-------------------------------
     if ($email == 'new_client_welcome_client') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('new_client_welcome_client');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         $this->email->to($this->data['email_vars']['client_users_email']);
         $this->email->subject($template['subject']);
         $this->email->message($email_message);
         $this->email->send();
     }
     //new client welcom email-------------------------------
     if ($email == 'new_client_admin') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('new_client_admin');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email to multiple admins
         foreach ($this->data['vars']['mailinglist_admins'] as $email_address) {
             email_default_settings();
             //defaults (from emailer helper)
             $this->email->to($email_address);
             $this->email->subject($template['subject']);
             $this->email->message($email_message);
             $this->email->send();
         }
     }
 }
Пример #3
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //specific passed variables
     foreach ($vars as $key => $value) {
         $this->data['email_vars'][$key] = $value;
     }
     //-------------send out email-------------------------------
     if ($email == 'new_payment') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('new_payment_admin');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email to multiple admins
         foreach ($this->data['vars']['mailinglist_admins'] as $email_address) {
             email_default_settings();
             //defaults (from emailer helper)
             $this->email->to($email_address);
             $this->email->subject($this->data['lang']['lang_new_payment']);
             $this->email->message($email_message);
             $this->email->send();
         }
     }
 }
Пример #4
0
 /**
  * send emails that are in the queue
  *
  */
 function __emailQueue()
 {
     //profiling
     $this->data['controller_profiling'][] = __FUNCTION__;
     //flow control
     $next = true;
     //get email queue data
     $queue = $this->email_queue_model->getEmailBatch(10);
     $this->data['debug'][] = $this->email_queue_model->debug_data;
     //loop throuh and send emails
     $delete_list = '';
     $found_email = false;
     //reset
     if ($next && is_array($queue)) {
         for ($i = 0; $i < count($queue); $i++) {
             //reset email settings
             $this->email->clear();
             //send email
             email_default_settings();
             //defaults (from emailer helper)
             //send
             $this->email->to($queue[$i]['email_queue_email']);
             $this->email->subject($queue[$i]['email_queue_subject']);
             $this->email->message($queue[$i]['email_queue_message']);
             $this->email->send();
             //comma separated list for later deleting from queue
             $delete_list .= ',' . $queue[$i]['email_queue_id'];
             //we sent some emails
             $found_email = true;
         }
     }
     //delete emails that have been sent
     if ($next && $found_email) {
         //prepre list of email id's
         $delete_list = trim($delete_list, ',');
         //delete emails
         $this->email_queue_model->deleteFromQueue($delete_list);
         $this->data['debug'][] = $this->email_queue_model->debug_data;
     }
 }
Пример #5
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //specific passed variables
     foreach ($vars as $key => $value) {
         $this->data['email_vars'][$key] = $value;
     }
     //new client welcom email-------------------------------
     if ($email == 'password_reset_start') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('password_reset_admin');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         $this->email->to($this->data['email_vars']['team_profile_email']);
         $this->email->subject($template['subject']);
         $this->email->message($email_message);
         $this->email->send();
     }
 }
Пример #6
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //common variables
     $this->data['email_vars']['clients_company_name'] = $this->client['clients_company_name'];
     $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];
     $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];
     $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];
     $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'];
     //-------------send out email-------------------------------
     if ($email == 'admin_notification_new_quotation') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('general_notification_admin');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //specific data
         $this->data['email_vars']['email_message'] = $this->data['lang']['lang_a_new_quotation_has_been_submitted'];
         $this->data['email_vars']['email_title'] = $this->data['lang']['lang_new_quotation_request'];
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email to multiple admins
         foreach ($this->data['vars']['mailinglist_admins'] as $email_address) {
             email_default_settings();
             //defaults (from emailer helper)
             $this->email->to($email_address);
             $this->email->subject($this->data['lang']['lang_new_quotation_request']);
             $this->email->message($email_message);
             $this->email->send();
         }
     }
 }
Пример #7
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //common variables
     $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];
     $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];
     $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];
     //specific passed variables
     foreach ($vars as $key => $value) {
         $this->data['email_vars'][$key] = $value;
     }
     //new client welcom email-------------------------------
     if ($email == 'login_reminder') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('password_reset_client');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         $this->email->to($this->data['email_vars']['client_users_email']);
         $this->email->subject($template['subject']);
         $this->email->message($email_message);
         $this->email->send();
     }
     //password has been reset----------------------------------------
     if ($email == 'password_reset') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('general_notification_client');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         $this->email->to($this->data['email_vars']['client_users_email']);
         $this->email->subject($this->data['lang']['lang_your_password_has_been_updated']);
         $this->email->message($email_message);
         $this->email->send();
     }
 }
Пример #8
0
 /**
  * send out an email
  *
  * @param string $email email address
  */
 function __emailer($email = '', $vars = array())
 {
     //common variables
     $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];
     $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];
     $this->data['email_vars']['client_dashboard_url'] = $this->data['vars']['site_url_client'];
     $this->data['email_vars']['currency_symbol'] = $this->data['settings_general']['currency_symbol'];
     //specific passed variables
     foreach ($vars as $key => $value) {
         $this->data['email_vars'][$key] = $value;
     }
     //-------------send out email-------------------------------
     if ($email == 'quotation_updated') {
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('new_quotation_client');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         $this->email->to($this->input->post('clients_email'));
         $this->email->subject($template['subject']);
         $this->email->message($email_message);
         $this->email->send();
     }
 }
Пример #9
0
 /**
  * send out an email
  *
  * @access	private
  * @param	string
  * @return	void
  */
 function __emailer($email = '', $vars = array())
 {
     //common variables
     $this->data['email_vars']['todays_date'] = $this->data['vars']['todays_date'];
     $this->data['email_vars']['company_email_signature'] = $this->data['settings_company']['company_email_signature'];
     $this->data['email_vars']['admin_dashboard_url'] = $this->data['vars']['site_url_admin'];
     //------------------------------------send out email-------------------------------
     if ($email == 'new_team_member') {
         $this->data['email_vars']['team_profile_full_name'] = $this->input->post('team_profile_full_name');
         $this->data['email_vars']['team_profile_email'] = $this->input->post('team_profile_email');
         $this->data['email_vars']['team_profile_password'] = $this->input->post('team_profile_password');
         //get message template from database
         $template = $this->settings_emailtemplates_model->getEmailTemplate('new_team_member');
         $this->data['debug'][] = $this->settings_emailtemplates_model->debug_data;
         //parse email
         $email_message = parse_email_template($template['message'], $this->data['email_vars']);
         //send email
         email_default_settings();
         //defaults (from emailer helper)
         $this->email->to($this->input->post('team_profile_email'));
         $this->email->subject($template['subject']);
         $this->email->message($email_message);
         $this->email->send();
     }
 }