b2in/app/Mail/PartnerInvitationMail.php
2025-11-21 18:21:23 +01:00

61 lines
1.6 KiB
PHP

<?php
namespace App\Mail;
use App\Models\PartnerInvitation;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class PartnerInvitationMail extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct(
public PartnerInvitation $invitation,
public string $invitationUrl
) {}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
subject: 'Einladung: ' . $this->invitation->company_name . ' - B2In Platform',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
markdown: 'emails.partner-invitation',
with: [
'invitation' => $this->invitation,
'invitationUrl' => $this->invitationUrl,
'companyName' => $this->invitation->company_name,
'contactFullName' => $this->invitation->contact_full_name,
'partnerType' => $this->invitation->role?->display_name ?? $this->invitation->role?->name,
'expiresAt' => $this->invitation->expires_at,
]
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}