use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
final class PendingNotifications extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public function __construct(
public readonly User $user,
public readonly int $pendingNotificationsCount,
) {
//
}
public function envelope(): Envelope
{
return new Envelope(
subject: '🌸 Pinkary: You Have '.$this->pendingNotificationsCount.' '.str('Notification')->plural($this->pendingNotificationsCount).'! - '.now()->format('F j, Y'),
);
}
public function content(): Content
{
return new Content(
markdown: 'mail.pending-notifications',
with: [
'date' => now()->format('Y-m-d'),
'user' => $this->user,
'pendingNotificationsCount' => $this->pendingNotificationsCount,
],
);
}
public function attachments(): array
{
return [];
}
}