I have the same issue as the first commenter modxxx, newsletter is sent but with no content, when I preview the ressource in the browser it looks as it should, so the content and the template seem to work. The module-settings are also correct and I can select the ressource with the newsletter content/template in the "New Newsletter" Popup-Box.
In the ModX error-log I get this after every try to send out a newsletter (which also arrives but as I said: empty):
[2011-04-03 22:12:16] (ERROR @ /home/path/core/components/ditsnews/model/ditsnews/ditsnews.class.php : 100) PHP warning: file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: URL file-access is disabled in the server configuration
[2011-04-03 22:12:16] (ERROR @ /home/path/core/components/ditsnews/model/ditsnews/ditsnews.class.php : 100) PHP warning: file_get_contents(http://url.tld/testnewsletter.html?smartytags=1) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: no suitable wrapper could be found
[2011-04-03 22:12:16] (ERROR @ /home/path/core/components/ditsnews/model/emogrifier/emogrifier.php : 66) PHP warning: DOMDocument::loadHTML() [<a href='domdocument.loadhtml'>domdocument.loadhtml</a>]: Document is empty in Entity, line: 1
as I understand it, the php function get_file_contents() seems not to be working (serverconfig?) and because I don’t want to enable this function due security reasons I googled a bit and found quickly an alternative with cURL, I had some difficulties with implementing it in the ditsnews.class script...so I did it very unprofessional (I think =D) and just inserted the following function inside of the "public function queueMessages($newsletterId, $documentId, $groups)"-function on line 63 in the ditsnews.class.php file.
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
and as a last modification I edited the line:
$message = file_get_contents($docUrl);
to
$message = file_get_contents_curl($docUrl);
now it works flawless, event the unsubscribing works perfectly!
Great script but maybe a check if file_get_contents() is available should be performed with the cURL functions as an alternative?
keep up the good work
PS: another improvement would be the registration date/time of the subscribers (also when it’s created manually)