You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's my code private function _sendVerificationEmail($user, $subject = "Please validate your account") { $message = Yii::$app->mailer->compose() ->setFrom('[email protected]') ->setTo($user->email_address) ->setSubject($subject) ->setTextBody("Hi, this is your verification code: " . $user->email_verification_hash . "\nPlease ignore if you did not request it"); return Yii::$app->mailer->send($message); }
Hi, i'm currently trying to implement your library to my project.
I'm use PostgreSQL as my database connection and got this error message
PHP Notice 'yii\base\ErrorException' with message 'unserialize(): Error at offset 112 of 116 bytes'
in /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/bazilio/yii2-async/transports/AsyncMysqlTransport.php:88
Here's the stack trace
Stack trace: #0 [internal function]: yii\base\ErrorHandler->handleError(8, 'unserialize(): ...', '/Users/samdgea/...', 88, Array)
#1 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/bazilio/yii2-async/transports/AsyncMysqlTransport.php(88): unserialize('O:46:"YarCode\\Y...')
#2 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/bazilio/yii2-async/AsyncComponent.php(48): bazilio\async\transports\AsyncMysqlTransport->receive('mailer', false)
#3 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yarcode/yii2-async-mailer/src/MailerCommand.php(24): bazilio\async\AsyncComponent->receiveTask('mailer')
#4 [internal function]: YarCode\Yii2\AsyncMailer\MailerCommand->YarCode\Yii2\AsyncMailer\{closure}(Object(React\EventLoop\Timer\Timer))
#5 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/react/react/src/EventLoop/Timer/Timers.php(90): call_user_func(Object(Closure), Object(React\EventLoop\Timer\Timer))
#6 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/react/react/src/EventLoop/StreamSelectLoop.php(177): React\EventLoop\Timer\Timers->tick()
#7 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yarcode/yii2-daemon/src/DaemonCommand.php(25): React\EventLoop\StreamSelectLoop->run()
#8 [internal function]: YarCode\Yii2\Daemon\DaemonCommand->actionDaemon()
#9 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#10 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)
#11 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/console/Controller.php(148): yii\base\Controller->runAction('daemon', Array)
#12 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/base/Module.php(528): yii\console\Controller->runAction('daemon', Array)
#13 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('mailer/daemon', Array)
#14 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('mailer/daemon', Array)
#15 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/vendor/yiisoft/yii2/base/Application.php(386): yii\console\Application->handleRequest(Object(yii\console\Request))
#16 /Users/samdgea/Documents/Workspace/Yii2/sipk-yii2/yii(20): yii\base\Application->run()
#17 {main}
Here's my code
private function _sendVerificationEmail($user, $subject = "Please validate your account")
{
$message = Yii::$app->mailer->compose()
->setFrom('[email protected]')
->setTo($user->email_address)
->setSubject($subject)
->setTextBody("Hi, this is your verification code: " . $user->email_verification_hash . "\nPlease ignore if you did not request it");
return Yii::$app->mailer->send($message);
}
and this is my configuration file
$config = [
....
'mailer' => [
'class' => \YarCode\Yii2\AsyncMailer\Mailer::class,
'syncMailer' => [
'class' => yii\swiftmailer\Mailer::class,
'useFileTransport' => true,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.mailtrap.io',
'username' => 'xx',
'password' => '9xx',
'port' => '2525',
'encryption' => 'tls',
],
],
],
...
];
The text was updated successfully, but these errors were encountered: