- CertificateReadyMail: Mailable with Malay HTML email template - SendCertificateEmailJob: dispatch per-certificate email, log to email_logs - Email template: HTML with download link, program details, branding Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
717 B
PHP
32 lines
717 B
PHP
<?php
|
|
|
|
namespace App\Mail;
|
|
|
|
use App\Models\Certificate;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Mail\Mailable;
|
|
use Illuminate\Mail\Mailables\Content;
|
|
use Illuminate\Mail\Mailables\Envelope;
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
class CertificateReadyMail extends Mailable
|
|
{
|
|
use Queueable, SerializesModels;
|
|
|
|
public function __construct(public readonly Certificate $certificate) {}
|
|
|
|
public function envelope(): Envelope
|
|
{
|
|
return new Envelope(
|
|
subject: 'Sijil Digital Program — ' . $this->certificate->program->title,
|
|
);
|
|
}
|
|
|
|
public function content(): Content
|
|
{
|
|
return new Content(
|
|
view: 'emails.certificate-ready',
|
|
);
|
|
}
|
|
}
|