sls/app/Mail/CandidateInterviewInvitationMail.php
kushal.saha e4fabef1d3 feat(interview): add icalendar invites, white date pickers, and drawer validation feedback
- integrate spatie/icalendar-generator for candidate & panelist .ics invitations (RSVP & 15m alerts)
    - add StoreInterviewRequest, ScheduleInterviewDto, and invitation/reminder queued actions
    - add migration for job_title, round, description, and reminder_sent_at on interviews table
    - style datetime-local picker indicators to pure white on dark input backgrounds
    - support button loading spinners with :showLoader="true" and loadingText
    - auto-open schedule drawer on validation failure with inline @error alerts and old() bindings
2026-08-27 10:16:46 +00:00

65 lines
1.6 KiB
PHP

<?php
namespace App\Mail;
use App\Models\Interview;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Attachment;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;
class CandidateInterviewInvitationMail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*/
public function __construct(
public readonly Interview $interview,
public readonly string $icsContent,
public readonly string $icsFilename = 'invitation.ics',
) {
$this->afterCommit();
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
$jobTitle = $this->interview->job_title ?: 'Candidate Assessment';
$round = $this->interview->round ?: 'R1';
return new Envelope(
subject: "Interview Invitation: {$this->interview->candidate_name} - {$jobTitle} ({$round})",
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'emails.interview.candidate-invitation',
);
}
/**
* Get the attachments for the message.
*
* @return array<int, Attachment>
*/
public function attachments(): array
{
return [
Attachment::fromData(fn () => $this->icsContent, $this->icsFilename)
->withMime('text/calendar; charset=UTF-8; method=REQUEST'),
];
}
}