email send using queue with attachment laravel

Solutions on MaxInterview for email send using queue with attachment laravel by the best coders in the world

showing results for - "email send using queue with attachment laravel"
Pablo
21 Mar 2019
1<?php
2
3namespacde App\Mail;
4
5use Illuminate\Bus\Queueable;
6use Illuminate\Mail\Mailable;
7use Illuminate\Queue\SerializesModels;
8use Illuminate\Contracts\Queue\ShouldQueue;
9
10class SendMailWithAttachment extends Mailable implements ShouldQueue
11{
12    use Queueable, SerializesModels;
13
14    /**
15    * Create a new message instance.
16    *
17    * @return void
18    */
19    public function __construct()
20    {
21        //
22    }
23
24    /**
25    * Build the message.
26    *
27    * @return $this
28    */
29    public function build()
30    {
31          return $this->to('test@example.com')
32              ->attach(storage_path('app/1569316022.jpg'))
33              ->markdown('mail_example');
34    }
35}
36
Dario
05 Oct 2016
1<?php
2
3namespace App\Mail;
4
5use Illuminate\Bus\Queueable;
6use Illuminate\Mail\Mailable;
7use Illuminate\Queue\SerializesModels;
8use Illuminate\Contracts\Queue\ShouldQueue;
9
10d{
11    use Queueable, SerializesModels;
12
13    /**
14    * Create a new message instance.
15    *
16    * @return void
17    */
18    public function __construct()
19    {
20        //
21    }
22
23    /**
24    * Build the message.
25    *
26    * @return $this
27    */
28    public function build()
29    {
30          return $this->to('test@example.com')
31              ->attach(storage_path('app/1569316022.jpg'))
32              ->markdown('mail_example');
33    }
34}
35