where('status', 1)->exists()) { Log::warning('OrderCreatedJob: Template "order_created" not found or inactive.'); return; } try { $emailTemplateService->send('order_created', $this->data['customer_email'], $this->data); } catch (\Throwable $e) { Log::error('OrderCreatedJob: Failed to send email. ' . $e->getMessage(), [ 'customer_email' => $this->data['customer_email'], 'order_num' => $this->data['order_num'] ?? null, ]); } } }