diff --git a/zmsentities/src/Zmsentities/Helper/Messaging.php b/zmsentities/src/Zmsentities/Helper/Messaging.php index e851399c0..9040d17df 100644 --- a/zmsentities/src/Zmsentities/Helper/Messaging.php +++ b/zmsentities/src/Zmsentities/Helper/Messaging.php @@ -196,7 +196,7 @@ public static function getNotificationContent(Process $process, Config $config, protected static function getTemplate($type, $status, ?Process $process = null) { if ($process) { - $provider = $process->getCurrentScope()->getProvider(); + $provider = $process->getFirstAppointment()->getScope()->getProvider(); $providerName = $provider->getDisplayName() ?? $provider->getName(); $providerTemplateName = self::getProviderTemplateName($providerName); $providerTemplate = 'custom/' . $type . '/' . $status . '/' . $providerTemplateName . '.twig';