61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\ClientMeeting;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class ClientMeetingInviteMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public ClientMeeting $meeting;
|
|
public string $recipientName;
|
|
public string $joinUrl;
|
|
|
|
/**
|
|
* Create a new message instance.
|
|
*/
|
|
public function __construct(ClientMeeting $meeting, string $recipientName = 'Participant', ?string $joinUrl = null)
|
|
{
|
|
$this->meeting = $meeting;
|
|
$this->recipientName = $recipientName;
|
|
$this->joinUrl = $joinUrl ?? $meeting->join_url;
|
|
}
|
|
|
|
/**
|
|
* Get the message envelope.
|
|
*/
|
|
public function envelope(): Envelope
|
|
{
|
|
$prefix = $this->meeting->meeting_type === 'instant' ? '⚡ Instant Meeting Invitation' : '📅 Meeting Invitation';
|
|
return new Envelope(
|
|
subject: "{$prefix}: {$this->meeting->title} - {$this->meeting->client->project_name}",
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the message content definition.
|
|
*/
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
view: 'emails.meeting_invite',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Get the attachments for the message.
|
|
*
|
|
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
|
|
*/
|
|
public function attachments(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|