44 lines
1.3 KiB
PHP
44 lines
1.3 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 ReportRejectedNotificationToUser extends Notification implements ShouldQueue
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(
|
|
private readonly string $dealTitle,
|
|
) {}
|
|
|
|
public function via($notifiable): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
public function toMail($notifiable): MailMessage
|
|
{
|
|
|
|
return (new MailMessage)
|
|
->subject('Update on Your Recent Report: '.$this->dealTitle)
|
|
->greeting('Hello!')
|
|
->line('Thank you for helping us maintain the integrity of our marketplace.')
|
|
->line("We have completed our review of the deal you reported: **{$this->dealTitle}**.")
|
|
->line('Based on our moderation policy, we have rejected your report.')
|
|
->action('View Marketplace', route('explore'))
|
|
->line('Your feedback helps make our community a safer place for everyone.');
|
|
}
|
|
|
|
public function toArray($notifiable): array
|
|
{
|
|
return [
|
|
'report_outcome' => $this->isContentRemoved ? 'violation_confirmed' : 'no_violation_found',
|
|
'deal_title' => $this->dealTitle,
|
|
];
|
|
}
|
|
}
|