This commit is contained in:
baodev0
2026-10-05 09:30:24 +07:00
parent a1aeb88061
commit 1544629a1f
53 changed files with 1292 additions and 963 deletions
@@ -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>'