45 lines
1.3 KiB
PHP
45 lines
1.3 KiB
PHP
<?php
|
|
namespace App\Mail;
|
|
|
|
use App\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
class MailActivateUser extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
protected $token;
|
|
public $subject;
|
|
|
|
public function __construct($token, User $user)
|
|
{
|
|
$this->token = $token;
|
|
$this->user = $user;
|
|
$this->subject = __('email.change_e_mail');
|
|
}
|
|
public function build()
|
|
{
|
|
$salutation = __('email.salutation').",";
|
|
|
|
if($this->user->account){
|
|
if($this->user->account->salutation == "mr"){
|
|
$salutation = __('email.dear_sir')." ".$this->user->account->first_name.",";
|
|
}else{
|
|
$salutation = __('email.dear_mrs')." ".$this->user->account->first_name.",";
|
|
}
|
|
}
|
|
return $this->view('emails.auth')->with([
|
|
'url' => route('user_update_email_confirm', $this->token),
|
|
'salutation' => $salutation,
|
|
'button' => __('email.change_e_mail'),
|
|
'copy1line' => __('email.active_copy1line'),
|
|
'copy2line' => __('email.copy2line'),
|
|
'copy3line' => __('email.copy3line'),
|
|
'greetings' => __('email.greetings'),
|
|
'sender' => __('email.sender'),
|
|
]);
|
|
}
|
|
}
|