38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\Household;
|
|
use App\Notifications\Concerns\RoutesByPreferences;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class HouseholdRejected extends Notification
|
|
{
|
|
use Queueable, RoutesByPreferences;
|
|
|
|
public const PREF_KEY = 'household_status';
|
|
|
|
public function __construct(public readonly Household $household, public readonly string $reason) {}
|
|
|
|
public function toArray(mixed $notifiable): array
|
|
{
|
|
return [
|
|
'type' => 'household.rejected',
|
|
'household_id' => $this->household->uuid,
|
|
'reason' => $this->reason,
|
|
'message' => 'Your household application needs attention.',
|
|
'action_label' => 'Fix Issues',
|
|
'action_url' => '/household',
|
|
];
|
|
}
|
|
|
|
public function toSms(mixed $notifiable): array
|
|
{
|
|
return [
|
|
'to' => $notifiable->phone,
|
|
'message' => "Verde: Household verification rejected. Reason: {$this->reason}. Update your details and resubmit.",
|
|
];
|
|
}
|
|
}
|