mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-13 18:23:57 -04:00
Email config (#2968)
This commit is contained in:
10
application/config/email.php
Normal file
10
application/config/email.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
$config['default_email_address'] = "";
|
||||
$config['default_cc_address'] = '';
|
||||
$config['default_sender_name'] = "";
|
||||
$config['default_sender_address'] = "";
|
||||
$config['default_bounce_address'] = "";
|
||||
$config['charset'] = 'utf-8';
|
||||
$config['mailtype'] = 'html';
|
||||
$config['wordwrap'] = FALSE;
|
||||
|
||||
35
application/libraries/MY_Email.php
Executable file
35
application/libraries/MY_Email.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
class MY_Email extends CI_Email {
|
||||
|
||||
var $default_cc_address = "";
|
||||
var $default_email_address = "";
|
||||
var $default_sender_name = "";
|
||||
var $default_sender_address = "";
|
||||
var $default_bounce_address = "";
|
||||
|
||||
function __construct($config = array())
|
||||
{
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
function send_mail($subject, $body, $to = NULL, $reply_name = NULL, $reply_mail = NULL, $attachment = NULL) {
|
||||
$this->reply_to($reply_mail, $reply_name);
|
||||
$this->from($this->default_sender_address, $this->default_sender_name, $this->default_bounce_address);
|
||||
$this->set_mailtype('html');
|
||||
$this->subject($subject);
|
||||
$this->message($body);
|
||||
if ($to == NULL) {
|
||||
$to = $this->default_email_address;
|
||||
$this->cc($this->default_cc_address);
|
||||
}
|
||||
if ($attachment) {
|
||||
$this->attach($attachment);
|
||||
}
|
||||
$this->to($to);
|
||||
return $this->send();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user