Files

59 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2024-10-24 16:36:54 -05:00
<?php
2025-01-28 17:33:54 -06:00
declare(strict_types=1);
2024-10-24 16:36:54 -05:00
namespace App\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
2025-01-28 17:14:49 -06:00
use Illuminate\Notifications\Notification;
2024-10-24 16:36:54 -05:00
class ImportFailedNotification extends Notification implements ShouldQueue
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(
public string $errorMessage
2025-01-28 17:14:49 -06:00
) {}
2024-10-24 16:36:54 -05:00
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
2025-01-28 17:14:49 -06:00
->greeting('Oh no!')
->subject('Your Investbrain import failed!')
->line('Heads up, your Investbrain import was unable to successfully complete. There were errors which caused the import to fail.')
->action('Try again?', route('import-export'))
->line('**Technical details:**')
->line($this->errorMessage);
2024-10-24 16:36:54 -05:00
}
/**
* Get the array representation of the notification.
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
//
];
}
}