db); $company_user = $this->task->assignedCompanyUser(); if($this->findEntityAssignedNotification($company_user, 'task')) { $mo = new EmailObject(); $mo->subject = ctrans('texts.task_assigned_subject', ['task' => $this->task->number, 'date' => now()->setTimeZone($this->task->company->timezone()->name)->format($this->task->company->date_format()) ]); $mo->body = ctrans('texts.task_assigned_body',['task' => $this->task->number, 'description' => $this->task->description ?? '', 'client' => $this->task->client ? $this->task->client->present()->name() : ' ']); $mo->text_body = ctrans('texts.task_assigned_body',['task' => $this->task->number, 'description' => $this->task->description ?? '', 'client' => $this->task->client ? $this->task->client->present()->name() : ' ']); $mo->company_key = $this->task->company->company_key; $mo->html_template = 'email.template.generic'; $mo->to = [new Address($this->task->assigned_user->email, $this->task->assigned_user->present()->name())]; $mo->email_template_body = 'task_assigned_body'; $mo->email_template_subject = 'task_assigned_subject'; (new Email($mo, $this->task->company))->handle(); } } public function failed($exception = null) { } }