mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-22 11:52:14 +09:00
Fix serialization error when sending email by SMTP in background task
https://xetown.com/questions/1842571
This commit is contained in:
parent
9e1772285a
commit
8473eeabc3
2 changed files with 30 additions and 27 deletions
|
|
@ -7,15 +7,6 @@ namespace Rhymix\Framework\Drivers\Mail;
|
|||
*/
|
||||
class MailFunction extends Base implements \Rhymix\Framework\Drivers\MailInterface
|
||||
{
|
||||
/**
|
||||
* Direct invocation of the constructor is not permitted.
|
||||
*/
|
||||
protected function __construct()
|
||||
{
|
||||
include_once \RX_BASEDIR . 'common/libraries/swift_mail.php';
|
||||
$this->_mailer = new \Swift_Mailer(new \Swift_MailTransport);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the human-readable name of this mail driver.
|
||||
*
|
||||
|
|
@ -58,6 +49,12 @@ class MailFunction extends Base implements \Rhymix\Framework\Drivers\MailInterfa
|
|||
*/
|
||||
public function send(\Rhymix\Framework\Mail $message)
|
||||
{
|
||||
if ($this->_mailer === null)
|
||||
{
|
||||
include_once \RX_BASEDIR . 'common/libraries/swift_mail.php';
|
||||
$this->_mailer = new \Swift_Mailer(new \Swift_MailTransport);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$errors = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue