Skip to content

Instantly share code, notes, and snippets.

@XavRsl
Created October 23, 2017 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XavRsl/3ce7f866310f0fd76c8b982d1316910f to your computer and use it in GitHub Desktop.
Save XavRsl/3ce7f866310f0fd76c8b982d1316910f to your computer and use it in GitHub Desktop.
<?php
namespace App\Notifications;
use App\Services\ModelHasher;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class VerifyEmail extends Notification
{
use Queueable;
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
*
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
*
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
return (new MailMessage())
->subject('Email verification needed')
->action(
'Verify your email',
url('/subscriber/verify?token='.(new ModelHasher())->encode($notifiable))
)
->line('Thank you.');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment