diff --git a/.gitignore b/.gitignore index 69db029..b2337dc 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,5 @@ Thumbs.db *.mov *.wmv + +docs/ diff --git a/application/controllers/shared/Users.php b/application/controllers/shared/Users.php index b351f50..acfef25 100644 --- a/application/controllers/shared/Users.php +++ b/application/controllers/shared/Users.php @@ -1,5 +1,8 @@ Users_model->get_record_by_id($userid); $data = array('username'=>$user->gnaam, 'password'=>$ww, 'fullname'=>$this->Users_model->get_fullname($userid)); $org = $this->getBijlage($orgid); - $this->load->library('email'); - - $this->email->from('noreply@framework.nl', 'Framework+ MonPas'); - $this->email->to($user->email); - $this->email->subject('Inloggegevens MonPas'); - $this->email->message($this->load->view('emails/newuser_mail', $data, TRUE)); - $this->email->bcc("rfranke@framework-ed.nl"); - if ($org->randomname) - $this->email->attach('./../docs/'.$org->randomname,'attachment', $org->bijlagefile); - $this->email->send(); + + $html = $this->load->view('emails/newuser_mail', $data, TRUE); + $mg = Mailgun::create( $_ENV['MAIL']['APIKEY'] ); // For US servers + $mg->messages()->send( $_ENV['MAIL']['DOMAIN'], [ + 'from' => 'info@monpas.nl', + 'to' => $user->email, + 'cc' => 'rfranke@framework-ed.nl', + 'subject' => 'Inloggegevens MonPas', + 'html' => $html, + 'attachment' => [ + [ + 'filename' => $org->bijlagefile, + 'filePath' => MYROOTPATH. 'docs/'.$org->randomname + ] + ], + 'inline' => [ + [ + 'filename' => 'monpasklein.png', + 'filePath' => FCPATH . 'css/images/monpasklein.png'] + ] + ] + ); + + + +// $this->load->library('email'); +// +// $this->email->from('noreply@framework.nl', 'Framework+ MonPas'); +// $this->email->to($user->email); +// $this->email->subject('Inloggegevens MonPas'); +// $this->email->message($this->load->view('emails/newuser_mail', $data, TRUE)); +// $this->email->bcc("rfranke@framework-ed.nl"); +// if ($org->randomname) +// $this->email->attach('./../docs/'.$org->randomname,'attachment', $org->bijlagefile); +// $this->email->send(); } function updateuser2(){ @@ -366,4 +394,4 @@ class Users extends MY_Controller{ $user=$this->Users_model->getorggebruikers($orgid, $userid); echo json_encode($user); } -} \ No newline at end of file +} diff --git a/application/views/emails/newuser_mail.php b/application/views/emails/newuser_mail.php index 9e059e6..74ed91d 100644 --- a/application/views/emails/newuser_mail.php +++ b/application/views/emails/newuser_mail.php @@ -10,7 +10,7 @@
- +

Beste ,

@@ -38,4 +38,4 @@

- \ No newline at end of file +