GithubHelp home page GithubHelp logo

yii2-async-mailer's People

Contributors

grptx avatar metalagman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yii2-async-mailer's Issues

Daemon crash

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',
],
],
],
...
];

Why mailer command need to execute select 1

Hi, i'm currently trying to implement your library to my project.
Can i ask question, why in MailerCommand class need to execute SELECT 1 from $app->db?
Actually my app has no database connection, except redis connection that this library needed.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.