File manager - Edit - /var/www/html/homologBancodetalentos/app/Mail/TalentBank/ApplicationEventMail.php
Back
<?php namespace App\Mail\TalentBank; use App\Models\TalentBank\Candidate; use App\Models\TalentBank\JobListing; use App\Support\TalentBank\ApplicationNotificationPresenter; use App\Support\TalentBank\ApplicationNotificationType; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailables\Content; use Illuminate\Mail\Mailables\Envelope; use Illuminate\Queue\SerializesModels; class ApplicationEventMail extends Mailable { use Queueable, SerializesModels; public JobListing $job; public Candidate $candidate; public string $subjectLine; public string $headline; public string $messageBody; public string $ctaUrl; public string $ctaLabel; /** @var array<string, mixed> */ public array $context; /** * @param array<string, mixed> $context */ public function __construct( public string $notificationType, public string $audience, JobListing $job, Candidate $candidate, array $context = [], ) { $this->context = $context; $this->job = $job->loadMissing('company', 'occupation'); $this->candidate = $candidate; $copy = $audience === 'company' ? ApplicationNotificationPresenter::forCompany($notificationType, $this->job, $this->candidate, $context) : ApplicationNotificationPresenter::forCandidate($notificationType, $this->job, $this->candidate, $context); $this->subjectLine = $copy['subject']; $this->headline = $copy['title']; $this->messageBody = $copy['body']; $this->ctaUrl = $audience === 'company' ? route('talent-bank.company.jobs.applicants', $this->job) : route('talent-bank.candidate.profile'); $this->ctaLabel = $audience === 'company' ? 'Ver candidatos' : 'Ver minhas candidaturas'; } public function envelope(): Envelope { return new Envelope( subject: $this->subjectLine, ); } public function content(): Content { return new Content( view: 'mail.talent-bank.application-event', with: [ 'headline' => $this->headline, 'messageBody' => $this->messageBody, 'job' => $this->job, 'candidate' => $this->candidate, 'ctaUrl' => $this->ctaUrl, 'ctaLabel' => $this->ctaLabel, 'notificationType' => $this->notificationType, 'status' => $this->context['status'] ?? null, ], ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings