Merge branch 'master' of https://bitbucket.org/pensare/monpas
This commit is contained in:
@@ -218,33 +218,36 @@ class Login extends MY_Controller {
|
||||
$data = ['username' => $username, 'password' => $password, 'fullname' => $this->Users_model->get_fullname( $userid )];
|
||||
|
||||
$html = $this->load->view( 'emails/newpassword_mail', $data, TRUE );
|
||||
if( $_ENV['ENVIRONMENT'] == 'production')
|
||||
{
|
||||
//Deze code wordt alleen op produktie gebruikt en stuurt de mail
|
||||
//naar Mailgun via een API (Codeigniter email library wordt niet gebruikt
|
||||
$mg = Mailgun::create( $_ENV['MAIL']['APIKEY'] );
|
||||
$mg->messages()->send( $_ENV['MAIL']['DOMAIN'], [
|
||||
'from' => 'info@monpas.nl',
|
||||
'to' => $email,
|
||||
'cc' => 'rfranke@framework-ed.nl',
|
||||
'subject' => 'Inloggegevens MonPas',
|
||||
'html' => $html,
|
||||
'inline' => [
|
||||
[
|
||||
'filename' => 'monpasklein.png',
|
||||
'filePath' => FCPATH . 'css/images/monpasklein.png']
|
||||
]
|
||||
] );
|
||||
}else{
|
||||
$this->load->library( 'email' );
|
||||
|
||||
$this->email->from( 'noreply@framework.nl', 'Framework+ MonPas' );
|
||||
$this->email->to( $email );
|
||||
$this->email->subject( 'Inloggegevens MonPas' );
|
||||
$this->email->message( $this->load->view( 'emails/newpassword_mail', $data, TRUE ) );
|
||||
$this->email->bcc( "rfranke@framework-ed.nl" );
|
||||
$this->email->send();
|
||||
}
|
||||
$this->Mail_model->sendTheEmail($email, 'Inloggegevens MonPas', $html, "rfranke@framework-ed.nl");
|
||||
|
||||
// if( $_ENV['ENVIRONMENT'] == 'production')
|
||||
// {
|
||||
// //Deze code wordt alleen op produktie gebruikt en stuurt de mail
|
||||
// //naar Mailgun via een API (Codeigniter email library wordt niet gebruikt
|
||||
// $mg = Mailgun::create( $_ENV['MAIL']['APIKEY'] );
|
||||
// $mg->messages()->send( $_ENV['MAIL']['DOMAIN'], [
|
||||
// 'from' => 'info@monpas.nl',
|
||||
// 'to' => $email,
|
||||
// 'cc' => 'rfranke@framework-ed.nl',
|
||||
// 'subject' => 'Inloggegevens MonPas',
|
||||
// 'html' => $html,
|
||||
// 'inline' => [
|
||||
// [
|
||||
// 'filename' => 'monpasklein.png',
|
||||
// 'filePath' => FCPATH . 'css/images/monpasklein.png']
|
||||
// ]
|
||||
// ] );
|
||||
// }else{
|
||||
// $this->load->library( 'email' );
|
||||
//
|
||||
// $this->email->from( 'noreply@framework.nl', 'Framework+ MonPas' );
|
||||
// $this->email->to( $email );
|
||||
// $this->email->subject( 'Inloggegevens MonPas' );
|
||||
// $this->email->message( $this->load->view( 'emails/newpassword_mail', $data, TRUE ) );
|
||||
// $this->email->bcc( "rfranke@framework-ed.nl" );
|
||||
// $this->email->send();
|
||||
// }
|
||||
|
||||
$result['errortekst'] = 'Er is een e-mail gestuurd naar ' . $email . ' met uw nieuwe wachtwoord.';
|
||||
$result['status'] = TRUE;
|
||||
|
||||
@@ -22,22 +22,22 @@ class Mail_model extends MY_Model{
|
||||
if ( ! is_array( $to ) ) $to = (array) $to;
|
||||
|
||||
foreach ( $to as $receiver ){
|
||||
$mailParts = explode( '@', $receiver );
|
||||
if (! $mailParts || count($mailParts) < 2)
|
||||
return $result="Er gaat iets fout met e-mail adres ".$receiver;
|
||||
|
||||
$mailParts = explode( '@', $receiver );
|
||||
if (! $mailParts || count($mailParts) < 2) return $result="Er gaat iets fout met e-mail adres ".$receiver;
|
||||
$this->email->to( $receiver );
|
||||
$this->email->from( 'info@monpas.nl', 'Framework MonPas' );
|
||||
if ( $cc ) $this->email->bcc( $cc );
|
||||
|
||||
// moet dit gebeuren? $this->setmail();
|
||||
$this->email->subject( $subject );
|
||||
$this->email->message( $html );
|
||||
|
||||
$this->email->to( $receiver );
|
||||
$this->email->from( 'info@monpas.nl', 'Framework MonPas' );
|
||||
if ( $cc ) $this->email->bcc( $cc );
|
||||
$sendResult = $this->email->send();
|
||||
|
||||
$this->email->subject( $subject );
|
||||
$this->email->message( $html );
|
||||
|
||||
if ( ! $this->email->send() ){
|
||||
$result = $this->email->print_debugger();
|
||||
};
|
||||
if ( ! $sendResult ){
|
||||
$result = $this->email->print_debugger();
|
||||
};
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user