<?php

namespace App\Mail;

use App\Models\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class AffiliateQualifiedMail extends Mailable
{
    use Queueable, SerializesModels;

    public $mailer = 'system';

    public function __construct(
        public User $affiliate,
        public User $referredUser,
        public int  $credits,
    ) {}

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: "Du hast {$this->credits} Credits verdient!",
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.affiliate-qualified',
        );
    }
}
