mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-01 13:26:59 -05:00
- Replaced TRUE/FALSE constants with true/false keywords - Replaced NULL constant with null keyword - Replaced `<?php echo` in views with shortened `<?=` - Added missing variable declaration - Added missing function return type in declaration - replaced `== true`, `== false`, `=== true` and `=== false` in if statements with simplified forms
37 lines
953 B
PHP
37 lines
953 B
PHP
<?php
|
|
|
|
namespace app\Libraries;
|
|
use CodeIgniter\Email\Email;
|
|
|
|
class MY_Email extends Email
|
|
{
|
|
var $default_cc_address = "";
|
|
var $default_email_address = "";
|
|
var $default_sender_name = "";
|
|
var $default_sender_address = "";
|
|
var $default_bounce_address = "";
|
|
|
|
function __construct($config = [])
|
|
{
|
|
parent::__construct($config);
|
|
}
|
|
|
|
function sendMail(string $subject, string $body, string $to = null, string $reply_name = null, string $reply_mail = null, string $attachment = null): bool
|
|
{
|
|
$this->setReplyTo($reply_mail, $reply_name);
|
|
$this->setFrom($this->default_sender_address, $this->default_sender_name, $this->default_bounce_address);
|
|
$this->setMailtype('html');
|
|
$this->setSubject($subject);
|
|
$this->setMessage($body);
|
|
if ($to == null) {
|
|
$to = $this->default_email_address;
|
|
$this->setCc($this->default_cc_address);
|
|
}
|
|
if ($attachment) {
|
|
$this->attach($attachment);
|
|
}
|
|
$this->setTo($to);
|
|
return $this->send();
|
|
}
|
|
}
|