// Loads an email template and compiles it
function loadEmailTemplate ($template, $content = array(), $userid = '0', $loadUserData = true) {
+ // @TODO $DATA is deprecated and should be avoided and replaced with $content
global $DATA;
// Make sure all template names are lowercase!
$code = str_replace($secChars['to'], $secChars['from'], $code);
// Find $content[bla][blub] entries
- // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
- preg_match_all('/\$(content|GLOBALS|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
+ // @TODO Do only use $content and deprecate $DATA in templates
+ preg_match_all('/\$(content|DATA)((\[([a-zA-Z0-9-_]+)\])*)/', $code, $matches);
// Are some matches found?
if ((count($matches) > 0) && (count($matches[0]) > 0)) {
} // END - foreach
// Skip this entry?
- if ($fuzzyFound === true) continue;
+ if ($fuzzyFound === true) {
+ continue;
+ } // END - if
// Take all string elements
if ((is_string($matches[4][$key])) && (!isset($matchesFound[$match])) && (!isset($matchesFound[$key.'_' . $matches[4][$key]]))) {