31 lines
823 B
PHP
31 lines
823 B
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
class EmailModel extends CI_Model
|
|
{
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
function sendMail($recipient, $subject, $template, $templateData) {
|
|
if(base_url() == 'http://192.168.178.39/') {
|
|
return;
|
|
}
|
|
|
|
$this->load->library('email');
|
|
|
|
$config['mailtype'] = 'html';
|
|
$this->email->initialize($config);
|
|
|
|
$this->email->from('no-reply@kingofdog.eu', 'KingOfDog.eu');
|
|
$this->email->to($recipient);
|
|
|
|
$this->email->subject($subject);
|
|
$this->email->message($this->load->view('emails/' . $template, $templateData, true));
|
|
|
|
$this->email->send();
|
|
}
|
|
|
|
} |