From 29d66c88abac579ffc013e1474e91c6f57fb911e Mon Sep 17 00:00:00 2001 From: Igor Manjencic Date: Wed, 13 Dec 2023 14:23:26 +0100 Subject: [PATCH] feat(ZMS-1711): fix loading template --- zmsentities/src/Zmsentities/Helper/Messaging.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zmsentities/src/Zmsentities/Helper/Messaging.php b/zmsentities/src/Zmsentities/Helper/Messaging.php index bcaa12942..478d0eb87 100644 --- a/zmsentities/src/Zmsentities/Helper/Messaging.php +++ b/zmsentities/src/Zmsentities/Helper/Messaging.php @@ -196,12 +196,13 @@ public static function getNotificationContent(Process $process, Config $config, protected static function getTemplate($type, $status, ?Process $process = null) { if ($process) { - $scopeName = $process->getCurrentScope()->getName(); - $scopeName = str_replace(['(', ')', '/'], '', $scopeName); - $scopeTemplate = 'custom/' . $type . '/' . $status . '/' . $scopeName . '.twig'; + $provider = $process->getCurrentScope()->getProvider(); + $providerName = $provider->getDisplayName() ?? $provider->getName(); + $providerName = str_replace(['(', ')', '/'], '', $providerName); + $providerTemplate = 'custom/' . $type . '/' . $status . '/' . $providerName . '.twig'; - if (file_exists(TemplateFinder::getTemplatePath() . '/messaging/' . $scopeTemplate)) { - return $scopeTemplate; + if (file_exists(TemplateFinder::getTemplatePath() . '/messaging/' . $providerTemplate)) { + return $providerTemplate; } }