update
This commit is contained in:
@@ -4,39 +4,27 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Mail\Admin;
|
||||
|
||||
use App\Mail\Concerns\RequiresDbTemplate;
|
||||
use App\Mail\TemplateMailable;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
use Illuminate\Mail\Mailables\Envelope;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class HostingAccountCreatedAdminNotification extends Mailable
|
||||
class HostingAccountCreatedAdminNotification extends TemplateMailable
|
||||
{
|
||||
use Queueable, SerializesModels, RequiresDbTemplate;
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public function __construct(public readonly array $data) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: $this->renderFromTemplate('admin_hosting_account_created', $this->vars())['subject'],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
htmlString: $this->renderFromTemplate('admin_hosting_account_created', $this->vars())['html'],
|
||||
);
|
||||
}
|
||||
|
||||
public function attachments(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function vars(): array
|
||||
protected function scenario(): string
|
||||
{
|
||||
return 'admin_hosting_account_created';
|
||||
}
|
||||
|
||||
protected function variables(): array
|
||||
{
|
||||
$row = fn (string $label, ?string $value) => $value
|
||||
? '<div class="cred-row"><span class="cred-label">' . $label . '</span><span class="cred-value">' . e($value) . '</span></div>'
|
||||
|
||||
Reference in New Issue
Block a user