mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
40 lines
1.0 KiB
PHP
40 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
|
|
use App\Events\Accounts\UserInvited;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
class InvitationEmail extends AbstractEmail
|
|
{
|
|
|
|
/** @var UserInvited */
|
|
private $invitation;
|
|
|
|
/**
|
|
* InvitationEmail constructor.
|
|
* @param UserInvited $invitation
|
|
*/
|
|
public function __construct(UserInvited $invitation) {
|
|
$this->invitation = $invitation;
|
|
}
|
|
|
|
public function toMail()
|
|
{
|
|
return (new MailMessage)
|
|
->subject('Registration Invite')
|
|
->line($this->senderName().' has sent you an invitation to create an account with us.')
|
|
->action('Create Account', $this->invitationUrl());
|
|
}
|
|
|
|
private function invitationUrl(){
|
|
return url(route('auth.registration', ['email' => $this->invitation->getData()->email, 'hash' => $this->invitation->getData()->hash]));
|
|
}
|
|
|
|
private function senderName(){
|
|
$sender = $this->invitation->getData()->sender;
|
|
return $sender->first_name.' '.$sender->last_name;
|
|
}
|
|
|
|
} |