update email template
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Mail\Admin;
|
||||
|
||||
use App\Mail\Concerns\RequiresDbTemplate;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Mail\Mailables\Content;
|
||||
@@ -10,22 +11,21 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class TrialRegistrationRequest extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
use Queueable, SerializesModels, RequiresDbTemplate;
|
||||
|
||||
public function __construct(public array $data) {}
|
||||
|
||||
public function envelope(): Envelope
|
||||
{
|
||||
return new Envelope(
|
||||
subject: '[ADMIN] Yêu cầu dùng thử Cloud VPS - ' . ($this->data['customer_name'] ?? 'N/A'),
|
||||
subject: $this->renderFromTemplate('admin_trial_registration_request', $this->vars())['subject'],
|
||||
);
|
||||
}
|
||||
|
||||
public function content(): Content
|
||||
{
|
||||
return new Content(
|
||||
view: 'emails.admin.trial-registration-request',
|
||||
with: $this->data,
|
||||
htmlString: $this->renderFromTemplate('admin_trial_registration_request', $this->vars())['html'],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -33,4 +33,22 @@ class TrialRegistrationRequest extends Mailable
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function vars(): array
|
||||
{
|
||||
return [
|
||||
'customer_name' => $this->data['customer_name'] ?? 'N/A',
|
||||
'customer_email' => $this->data['customer_email'] ?? 'N/A',
|
||||
'customer_phone' => $this->data['customer_phone'] ?? 'N/A',
|
||||
'cpu' => $this->data['cpu'] ?? '-',
|
||||
'ram' => $this->data['ram'] ?? '-',
|
||||
'ssd' => $this->data['ssd'] ?? '-',
|
||||
'os' => $this->data['os'] ?? '-',
|
||||
'other_row' => !empty($this->data['other'])
|
||||
? '<tr><td>Yêu cầu khác</td><td>' . e($this->data['other']) . '</td></tr>'
|
||||
: '',
|
||||
'company_name' => $this->data['company_name'] ?? 'Portal Admin',
|
||||
'created_at' => $this->data['created_at'] ?? now()->format('d/m/Y H:i:s'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user