\Mail with view inside a Job does not work #42627
Answered
by
systemsolutionweb
systemsolutionweb
asked this question in
Q&A
-
Description:When i try to send a mail using a view inside a Job doesn't work, on sync works Steps To Reproduce:This code works, \Mail::send('mails.emergency_call', [], function ($message) {
$message->to('[email protected]', 'Email Example');
}); but if you put the same code inside of handle method on a Job and when i call
class SendView implements ShouldQueue{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public function __construct(){
$this->onConnection('database');
}
public function handle(){
\Mail::send('mails.emergency_call', [], function ($message) {
$message->to('[email protected]', 'Email Example');
});
}
}
// SendView::dispatch(); |
Beta Was this translation helpful? Give feedback.
Answered by
systemsolutionweb
Jun 2, 2022
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
systemsolutionweb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#42607 (comment)