Files
anonaddy/app/Notifications/UsernameReminder.php
2022-07-07 08:44:47 +01:00

61 lines
1.6 KiB
PHP

<?php
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Symfony\Component\Mime\Email;
class UsernameReminder extends Notification implements ShouldQueue, ShouldBeEncrypted
{
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("AnonAddy Username Reminder")
->markdown('mail.username_reminder', [
'username' => $notifiable->user->username,
'recipientId' => $notifiable->id,
'fingerprint' => $notifiable->should_encrypt ? $notifiable->fingerprint : null
])
->withSymfonyMessage(function (Email $message) {
$message->getHeaders()
->addTextHeader('Feedback-ID', 'UR:anonaddy');
});
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
//
];
}
}