48 lines
1.5 KiB
PHP
48 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class ReportResolvedNotificationToBroker extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(
|
|
private readonly string $dealTitle,
|
|
private readonly bool $isContentRemoved
|
|
) {
|
|
}
|
|
|
|
public function via($notifiable): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
public function toMail($notifiable): MailMessage
|
|
{
|
|
$status = $this->isContentRemoved
|
|
? 'has been removed following a policy review.'
|
|
: 'has been reviewed and remains active.';
|
|
|
|
return (new MailMessage)
|
|
->subject('Update Regarding Your Reported Deal: '.$this->dealTitle)
|
|
->greeting('Hello!')
|
|
->line("We are writing to inform you that the report regarding your deal, **{$this->dealTitle}**, has been resolved.")
|
|
->line("Our moderation team has completed their review, and the content {$status}")
|
|
->action('View My Deals', route('broker.dashboard')) // Adjusted for your UMS/Project structure
|
|
->line('Thank you for being a part of our marketplace.');
|
|
}
|
|
|
|
public function toArray($notifiable): array
|
|
{
|
|
return [
|
|
'deal_title' => $this->dealTitle,
|
|
'action_taken' => $this->isContentRemoved ? 'removed' : 'kept',
|
|
];
|
|
}
|
|
}
|