42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use Illuminate\Notifications\Notification;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\URL;
|
|
|
|
class EmailVerificationNotification extends Notification
|
|
{
|
|
/**
|
|
* Get the notification's delivery channels.
|
|
*/
|
|
public function via($notifiable)
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
/**
|
|
* Build the mail representation of the notification.
|
|
*/
|
|
public function toMail($notifiable)
|
|
{
|
|
$url = URL::route(
|
|
'verification.verify', // Define route to verify the email
|
|
[
|
|
'id' => $notifiable->getKey(),
|
|
'hash' => sha1($notifiable->email)
|
|
]
|
|
);
|
|
|
|
return (new MailMessage)
|
|
->subject('Harap Verifikasi Alamat Email Baru Anda')
|
|
->greeting('Halo, ' . Auth::user()->name ?? 'User')
|
|
->line('Anda telah berhasil memperbarui alamat email Anda. Silakan klik tombol berikut untuk memverifikasi email Anda:')
|
|
->action('Verifikasi Email', $url)
|
|
->line('Jika Anda tidak merasa memperbarui email ini, Anda tidak perlu melakukan tindakan apapun.')
|
|
->salutation('Salam, Tim SIGD');
|
|
}
|
|
}
|