some
This commit is contained in:
50
kernel/Mailing.php
Normal file
50
kernel/Mailing.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace kernel;
|
||||
|
||||
use kernel\helpers\Debug;
|
||||
use kernel\helpers\SMTP;
|
||||
use PHPMailer\PHPMailer\Exception;
|
||||
|
||||
class Mailing
|
||||
{
|
||||
protected SMTP $SMTP;
|
||||
|
||||
protected CgView $cgView;
|
||||
protected array $data;
|
||||
|
||||
public function __construct(array $data = [])
|
||||
{
|
||||
$this->cgView = new CgView();
|
||||
$this->cgView->viewPath = KERNEL_DIR . "/views/mailing/";
|
||||
|
||||
$this->data = $data;
|
||||
|
||||
$this->SMTP = new SMTP();
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function send_html(string $tpl, array $tplParams, array $mailParams): ?false
|
||||
{
|
||||
$mailParams['body'] = $this->cgView->fetch($tpl, $tplParams);
|
||||
return $this->SMTP->send_html($mailParams);
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
}
|
||||
|
||||
public static function create(array $data = []): static
|
||||
{
|
||||
return new static($data);
|
||||
}
|
||||
|
||||
protected function init()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user