fix 1 otp
This commit is contained in:
@@ -22,6 +22,8 @@ class Mail_model extends MY_Model{
|
||||
if ( ! is_array( $to ) ) $to = (array) $to;
|
||||
|
||||
foreach ( $to as $receiver ){
|
||||
$this->email->clear();
|
||||
|
||||
$mailParts = explode( '@', $receiver );
|
||||
if (! $mailParts || count($mailParts) < 2)
|
||||
return $result="Er gaat iets fout met e-mail adres ".$receiver;
|
||||
@@ -45,16 +47,22 @@ class Mail_model extends MY_Model{
|
||||
|
||||
private function setmail(){
|
||||
if ( ENVIRONMENT == 'production' ){
|
||||
$config['protocol'] = 'smtp';
|
||||
$config['smtp_host'] = $_ENV['MAILGUN']['HOST'];
|
||||
$config['smtp_port'] = $_ENV['MAILGUN']['SMTP_PORT'];
|
||||
$config['smtp_user'] = $_ENV['MAILGUN']['SMTP_USER'];
|
||||
$config['smtp_pass'] = $_ENV['MAILGUN']['SMTP_PASS'];
|
||||
} else {
|
||||
$config['protocol'] = $_ENV['MAIL']['PROTOCOL'];
|
||||
$config['smtp_host'] = $_ENV['MAIL']['HOST'];
|
||||
$config['smtp_port'] = $_ENV['MAIL']['SMTP_PORT'];
|
||||
$config['smtp_user'] = $_ENV['MAIL']['SMTP_USER'];
|
||||
$config['smtp_pass'] = $_ENV['MAIL']['SMTP_PASS'];
|
||||
}
|
||||
$config['mailtype'] = 'html';
|
||||
$config['charset'] = 'iso-8859-1';
|
||||
$config['crlf'] = "\r\n";
|
||||
$config['newline'] = "\r\n";
|
||||
|
||||
$this->email->initialize( $config );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user