50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Notifications;
|
||
|
|
||
|
use App\ChangeEmail;
|
||
|
use App\User;
|
||
|
use Illuminate\Bus\Queueable;
|
||
|
use Illuminate\Mail\Mailable;
|
||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||
|
use Illuminate\Queue\SerializesModels;
|
||
|
|
||
|
class SendMailChange extends Mailable
|
||
|
{
|
||
|
use Queueable, SerializesModels;
|
||
|
|
||
|
/**
|
||
|
* The order instance.
|
||
|
*
|
||
|
* @var ChangeEmail
|
||
|
*/
|
||
|
public $change;
|
||
|
|
||
|
/**
|
||
|
* Create a new message instance.
|
||
|
*
|
||
|
* @param ChangeEmail $change
|
||
|
*/
|
||
|
public function __construct(ChangeEmail $change)
|
||
|
{
|
||
|
$this->change = $change;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Build the message.
|
||
|
*
|
||
|
* @return MailMessage
|
||
|
*/
|
||
|
public function build()
|
||
|
{
|
||
|
$user = User::findOrFail($this->change->user_id);
|
||
|
|
||
|
return (new MailMessage)
|
||
|
->subject('Change Email')
|
||
|
->line('Dear '.$user->firstname.',')
|
||
|
->line('Press the button bellow if you wish to change your current email-address')
|
||
|
->action('Change Email', url('/change/email/'.$user->id.'/'.$this->change->token.'/'.$this->change->email))
|
||
|
->line('Is this email not directed to you or do you not wish to change your email? Than you may ignore this.');
|
||
|
}
|
||
|
}
|