Skip to content

Instantly share code, notes, and snippets.

@victorsteven
Created April 15, 2019 16:58
Show Gist options
  • Save victorsteven/ee921fcef69d5691a47f6d9121aab2b3 to your computer and use it in GitHub Desktop.
Save victorsteven/ee921fcef69d5691a47f6d9121aab2b3 to your computer and use it in GitHub Desktop.
NewArrival mail class
<?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('wonderful@company.com', '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