It isn't how EmailResource does it, but the most reliable method would be to just get the pages with cURL. It's a little slow, but that way you get the fully processed page.
This code writes the page to a file, but should give you the idea. You could put the pagtitles or IDs in a comma-separated list in a snippet property and loop through them.
$ch = curl_init(); // Initialize Curl
if ($ch === false) {
echo "Failed to initialize cURL";
}
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
@curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); // don't use a cached version of the url
$url = 'http://localhost/addons/';
curl_setopt($ch, CURLOPT_URL, $url); // Set CURL options
$resource = curl_exec($ch); // get the page
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_errno($ch) . " - " . curl_error($ch);
} else {
$file = 'c:/xampp/htdocs/addons/assets/mycomponents/curltest/doc.html';
$fp = fopen($file,'w');
if (! $fp) {
echo 'Could not open file';
} else {
fwrite($fp,$resource);
fclose($fp);
}
}
curl_close($ch);
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html