Files
monica/app/Mail/StayInTouchEmail.php
T
Régis FreydandGitHub 29197090a7 Restructure where models are stored (#1476)
The idea is to clean the repository a little bit by moving models into their respective folders.
2018-06-14 20:49:12 -04:00

47 lines
1.0 KiB
PHP

<?php
namespace App\Mail;
use App\Models\User\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use App\Models\Contact\Contact;
use Illuminate\Support\Facades\App;
use Illuminate\Queue\SerializesModels;
class StayInTouchEmail extends Mailable
{
use Queueable, SerializesModels;
protected $contact;
protected $user;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct(Contact $contact, User $user)
{
$this->contact = $contact;
$this->user = $user;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
App::setLocale($this->user->locale);
return $this->text('emails.reminder.stayintouch')
->subject(trans('mail.stay_in_touch_subject_line', ['name' => $this->contact->name]))
->with([
'contact' => $this->contact,
'user' => $this->user,
]);
}
}