Skip to content

Commit

Permalink
Merge pull request #66 from it-at-m/feature-1711-custom-mail-templates
Browse files Browse the repository at this point in the history
feat(ZMS-1711): custom scope template
  • Loading branch information
manjencic authored Dec 13, 2023
2 parents 25755c3 + 36de873 commit 7ed31ea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zmsentities/src/Zmsentities/Helper/Messaging.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ public static function getNotificationContent(Process $process, Config $config,
protected static function getTemplate($type, $status, ?Process $process = null)
{
if ($process) {
$providerName = $process->getCurrentScope()->getProvider()->getName();
$providerName = str_replace(['(', ')', '/'], '', $providerName);
$providerTemplate = 'custom/' . $type . '/' . $status . '/' . $providerName . '.twig';
$scopeName = $process->getCurrentScope()->getName();
$scopeName = str_replace(['(', ')', '/'], '', $scopeName);
$scopeTemplate = 'custom/' . $type . '/' . $status . '/' . $scopeName . '.twig';

if (file_exists(TemplateFinder::getTemplatePath() . '/messaging/' . $providerTemplate)) {
return $providerTemplate;
if (file_exists(TemplateFinder::getTemplatePath() . '/messaging/' . $scopeTemplate)) {
return $scopeTemplate;
}
}

Expand Down

0 comments on commit 7ed31ea

Please sign in to comment.