Server IP : 66.29.132.124 / Your IP : 3.148.145.219 Web Server : LiteSpeed System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : wavevlvu ( 1524) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/wavevlvu/book24.ng/modules/User/Emails/ |
Upload File : |
<?php namespace Modules\User\Emails; use App\User; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; class UserPermanentlyDelete extends Mailable { use Queueable, SerializesModels; const CODE = [ 'first_name' => '[first_name]', 'last_name' => '[last_name]', 'name' => '[name]', 'email' => '[email]', ]; public $user; public $subject; public $content; public function __construct(User $user, $subject,$content) { $this->user = $user; $this->subject = $subject; $this->content = $content; } public function build() { if (empty($this->subject)) { $subject = __('[:site_name] Permanently Delete Account', ['site_name' => setting_item('site_title')]); } else { $subject = $this->replaceSubjectEmail($this->subject); } $body = $this->replaceContentEmail($this->content); return $this->subject($subject)->view('User::emails.user-permanently-delete')->with(['content' => $body]); } public function replaceSubjectEmail($subject) { if (!empty($subject)) { foreach (self::CODE as $item => $value) { if (method_exists($this, $item)) { $replace = $this->$item(); } else { $replace = ''; } $subject = str_replace($value, $replace, $subject); } } return $subject; } public function replaceContentEmail($content) { if (!empty($content)) { foreach (self::CODE as $item => $value) { $content = str_replace($value, @$this->user->$item, $content); } } return $content; } }