|
@@ -10,6 +10,7 @@ use App\Models\Enums\ObjectAction;
|
|
|
use App\Models\Requirement;
|
|
|
use App\Models\Task;
|
|
|
use App\Models\User;
|
|
|
+use App\Repositories\ActionRepository;
|
|
|
use App\Repositories\ConfigRepository;
|
|
|
use Illuminate\Contracts\Mail\Mailable;
|
|
|
use Illuminate\Support\Facades\Mail;
|
|
@@ -18,6 +19,8 @@ class ActionEmailService
|
|
|
{
|
|
|
protected ObjectAction $objectAction;
|
|
|
|
|
|
+ protected array $actions = [];
|
|
|
+
|
|
|
public function __construct(
|
|
|
protected Action $action
|
|
|
)
|
|
@@ -37,6 +40,8 @@ class ActionEmailService
|
|
|
|
|
|
$actionObjectModel = $actionObjectType->modelBuilder()->find($this->action->object_id);
|
|
|
|
|
|
+ $this->actions = ActionRepository::objectEmailActions($actionObjectType, $actionObjectModel->id, $this->action->id);
|
|
|
+
|
|
|
match ($actionObjectType) {
|
|
|
ActionObjectType::REQUIREMENT => $this->requirement($actionObjectModel),
|
|
|
ActionObjectType::TASK => $this->task($actionObjectModel),
|
|
@@ -52,7 +57,7 @@ class ActionEmailService
|
|
|
{
|
|
|
$userIds = array_filter([$task->assign, ...$task->mailto]);
|
|
|
|
|
|
- $this->dispatch($userIds, new TaskAction($task, $this->objectAction));
|
|
|
+ $this->dispatch($userIds, new TaskAction($task, $this->objectAction, $this->actions));
|
|
|
}
|
|
|
|
|
|
protected function dispatch(array $userIds, Mailable $mailable)
|