diff --git a/application/config/aauth.php b/application/config/aauth.php index 5ad4be9..1dcdb61 100644 --- a/application/config/aauth.php +++ b/application/config/aauth.php @@ -63,6 +63,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); | | ['email'] Sender email address, used for remind_password, send_verification and reset_password | ['name'] Sender name, used for remind_password, send_verification and reset_password +| ['email_config'] Array of Config for CI's Email Library | | ['verification'] User Verification, if TRUE sends a verification email on account creation. | ['verification_link'] Link for verification without site_url or base_url @@ -135,6 +136,7 @@ $config_aauth["default"] = array( 'email' => 'admin@admin.com', 'name' => 'Emre Akay', + 'email_config' => false, 'verification' => false, 'verification_link' => '/account/verification/', diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index 3ed039a..ef8f171 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -13,7 +13,7 @@ * * @copyright 2014-2016 Emre Akay * - * @version 2.5.5 + * @version 2.5.6 * * @license LGPL * @license http://opensource.org/licenses/LGPL-3.0 Lesser GNU Public License @@ -518,6 +518,10 @@ class Aauth { $this->aauth_db->where('email', $email); $this->aauth_db->update($this->config_vars['users'], $data); + if(is_array($this->config_vars['email_config'])){ + $this->CI->email->initialize($this->config_vars['email_config']); + } + $this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']); $this->CI->email->to($row->email); $this->CI->email->subject($this->CI->lang->line('aauth_email_reset_subject')); @@ -560,6 +564,10 @@ class Aauth { $this->aauth_db->where('id', $row->id); $this->aauth_db->update($this->config_vars['users'] , $data); + if(is_array($this->config_vars['email_config'])){ + $this->CI->email->initialize($this->config_vars['email_config']); + } + $this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']); $this->CI->email->to($email); $this->CI->email->subject($this->CI->lang->line('aauth_email_reset_success_subject')); @@ -944,6 +952,10 @@ class Aauth { $this->aauth_db->where('id', $user_id); $this->aauth_db->update($this->config_vars['users'], $data); + if(is_array($this->config_vars['email_config'])){ + $this->CI->email->initialize($this->config_vars['email_config']); + } + $this->CI->email->from( $this->config_vars['email'], $this->config_vars['name']); $this->CI->email->to($row->email); $this->CI->email->subject($this->CI->lang->line('aauth_email_verification_subject'));