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; } }