Created
April 15, 2019 16:58
-
-
Save victorsteven/ee921fcef69d5691a47f6d9121aab2b3 to your computer and use it in GitHub Desktop.
NewArrival mail class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Mail; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Mail\Mailable; | |
use Illuminate\Queue\SerializesModels; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
class NewArrivals extends Mailable | |
{ | |
use Queueable, SerializesModels; | |
protected $new_arrival; | |
protected $user; | |
public function __construct($user, $new_arrival) | |
{ | |
$this->user = $user; | |
$this->new_arrival = $new_arrival; | |
} | |
/** | |
* Build the message. | |
* | |
* @return $this | |
*/ | |
public function build() | |
{ | |
return $this->markdown('emails.newarrivals') | |
->subject($this->new_arrival->title) | |
->from('[email protected]', 'Wonderful Company') | |
->with([ | |
'user'=> $this->user, | |
'new_arrival' => $this->new_arrival, | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment