-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with ShouldQueue contract on mailable #38
Comments
Thanks for your report, I'm going to look into it. |
@joostdebruijn Your problem seems to be in the public function content(): Content
{
return new Content(
- markdown: $this->getView('mail.mailbook')
+ markdown: 'mail.mailbook'
);
} In case this does not work could you supply more context like OS, PHP version, Laravel version etc? |
@Xammie Thanks for looking at this issue, you're right: the However, the issue still persists and I found out that the issue happens when using the <?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class MailbookMail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
/**
* Get the message envelope.
*
* @return \Illuminate\Mail\Mailables\Envelope
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Welcome to mailbook!'
);
}
/**
* Get the message content definition.
*
* @return \Illuminate\Mail\Mailables\Content
*/
public function content(): Content
{
return new Content(
markdown: 'mail.mailbook'
);
}
} When removing |
Thanks again for reporting. This has been fixed in version 1.5.3. |
In my case the esign/laravel-email-whitelisting package caused the same error message. Even though it was disabled by setting The event dispatcher caused a halt. Can't figure out why. (i know this is not the concern of this wonderful package, but it might save other a few hours of debugging) |
It looks like this package doesn't work with the new style mailables as introduced in laravel/framework#44462. When using a new style mailable, the following error occurs:
Xammie\Mailbook\ResolvedMail::__construct(): Argument #1 ($message) must be of type Symfony\Component\Mime\Email, null given
.You can test it by replacing
App\Mail\MailbookMail
by this:The text was updated successfully, but these errors were encountered: