Download app/Jobs/SendEmail.php from pnacorp/magicai: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/pnacorp/magicai/resolve/main/app/Jobs/SendEmail.php
- Command line
-
hf download hf://pnacorp/magicai/app/Jobs/SendEmail.php
-
curl -L -o SendEmail.php https://huggingface.co/pnacorp/magicai/resolve/main/app/Jobs/SendEmail.php
1.01 kB
| namespace App\Jobs; | |
| use App\Models\Setting; | |
| use Illuminate\Bus\Queueable; | |
| use Illuminate\Contracts\Queue\ShouldQueue; | |
| use Illuminate\Foundation\Bus\Dispatchable; | |
| use Illuminate\Queue\InteractsWithQueue; | |
| use Illuminate\Queue\SerializesModels; | |
| use Illuminate\Support\Facades\Mail; | |
| class SendEmail implements ShouldQueue | |
| { | |
| use Dispatchable; | |
| use InteractsWithQueue; | |
| use Queueable; | |
| use SerializesModels; | |
| protected $user; | |
| protected $sendTo; | |
| protected $settings; | |
| protected $template; | |
| public function __construct(array $user, $sendTo, $template) | |
| { | |
| $this->user = $user; | |
| $this->sendTo = $sendTo; | |
| $this->settings = Setting::first(); | |
| $this->template = $template; | |
| } | |
| public function handle() | |
| { | |
| Mail::to($this->sendTo)->send( | |
| new \App\Mail\SendEmail($this->user, $this->settings, $this->template) | |
| ); | |
| if (config('queue.default') == 'sync') { | |
| sleep(rand(1, 4)); | |
| } | |
| } | |
| } | |