Hi,
i want to render to a document manually to be able to send it via Email. I want the template to be applied to, so it should render the same way if invoked within a browser.
I thought this would to it ($document is the correct document):
$document->process();
$document->_output = $document->_content;
/* collect any uncached element tags in the content and process them */
$modx->getParser();
$maxIterations= intval($modx->getOption('parser_max_iterations', $options, 10));
$modx->parser->processElementTags('', $document->_output, true, false, '[[', ']]', array(), $maxIterations);
$modx->parser->processElementTags('', $document->_output, true, true, '[[', ']]', array(), $maxIterations);
This is similar to what modResponse does, BUT somehow $document->process(); has a different result in my code than in the modResponse class. In the modResponse class the [[*content]] tag is correctly replaced while my manual call leaves it alone.
Any ideas how to achieve a full manual document parsing or what step is missing in my code?