|
@@ -0,0 +1,64 @@
|
|
|
|
+<?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 IncorrectOtpNotification 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)
|
|
|
|
+ {
|
|
|
|
+ $recipient = $notifiable->defaultRecipient;
|
|
|
|
+ $fingerprint = $recipient->should_encrypt ? $recipient->fingerprint : null;
|
|
|
|
+
|
|
|
|
+ return (new MailMessage())
|
|
|
|
+ ->subject("Failed Two Factor Authentication Login Attempt")
|
|
|
|
+ ->markdown('mail.failed_login_attempt', [
|
|
|
|
+ 'recipientId' => $recipient->id,
|
|
|
|
+ 'hasVerifiedEmail' => $recipient->hasVerifiedEmail(),
|
|
|
|
+ 'fingerprint' => $fingerprint,
|
|
|
|
+ 'username' => $notifiable->username
|
|
|
|
+ ])
|
|
|
|
+ ->withSymfonyMessage(function (Email $message) {
|
|
|
|
+ $message->getHeaders()
|
|
|
|
+ ->addTextHeader('Feedback-ID', 'FLA:anonaddy');
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Get the array representation of the notification.
|
|
|
|
+ *
|
|
|
|
+ * @param mixed $notifiable
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function toArray($notifiable)
|
|
|
|
+ {
|
|
|
|
+ return [
|
|
|
|
+ //
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+}
|