-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hello.
I'm trying to send attachments with e-mail, but are not being sended.
The email never comes, it's just to test.
If attachments are not send, the email arrives
Here is my code in App\Mail\OrderShipped.
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use function GuzzleHttp\Psr7\mimetype_from_filename;
class OrderShipped extends Mailable
{
use Queueable, SerializesModels;
protected $config;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($config)
{
$this->config = $config;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$attachments = json_decode($this->config['attachments']);
return $this->view('welcome')
->attach($attachments[0]->path, [
'as' => $attachments[0]->name,
'mime' => mimetype_from_filename($attachments[0]->path)
]);
}
}
Thanks.
HidanJashin
Metadata
Metadata
Assignees
Labels
No labels