-
Notifications
You must be signed in to change notification settings - Fork 127
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
InboundEmail->forward not working Laravel 10 #122
Comments
Is this project maintained? I want to use it, but ... cannot use it if its not maintained. |
I had the same issue. It looks like Symfony mailer changed syntaxis (https://laracasts.com/discuss/channels/laravel/body-must-be-of-type-mimepartabstractpart-string-given). @rtconner @mathewparet in case you haven't found a solution yet - here is what i did. It kinda works like a forward solution... public function forwardToAdmin(InboundEmail $email): void
{
Mail::to(config('app.admin.email'))->send(new ForwardEmail($email));
} class ForwardEmail extends Mailable
{
use Queueable, SerializesModels;
public function __construct(public InboundEmail $inboundEmail)
{
}
public function envelope(): Envelope
{
return new Envelope(
subject: "FROM: " . $this->inboundEmail->fromName() . " (" . $this->inboundEmail->from() . ") - " . $this->inboundEmail->subject(),
);
}
public function content(): Content
{
return new Content(
htmlString: $this->inboundEmail->html()
);
}
public function attachments(): array
{
return $this->inboundEmail->attachments();
}
} |
Fix issues with forwarding emails since Laravel 9.0 #127 |
Now just need a maintainer to approve the pull request. in the interrim if you want to fix the code yourself you can go to vendor > beyondcode > laravel-mailbox > src > InboundEmail.php and find this section (line 168 in mine)
and change to
|
@bardolf69 Thanks for posting the solution. My 2cs: We should create a new model that extends App\Models'InboundEmail:
config/mailbox.php: |
I get the below error when trying to forward email.
Error:
Code:
The text was updated successfully, but these errors were encountered: