FIX app email templates not resolving correctly

This commit is contained in:
Scott Hutchinson 2018-11-18 14:08:53 +13:00
parent 20ff59c0f8
commit 5cce7cb519

View File

@ -506,8 +506,8 @@ class EmailRecipient extends DataObject
$templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);
// Optionally remove "templates/" prefixes
if (substr($templatePath, 0, 10)) {
$templatePath = substr($templatePath, 10);
if (preg_match('/(?<=templates\/).*$/', $templatePath, $matches)) {
$templatePath = $matches[0];
}
$templates[$templatePath] = $template['filename'];