We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32004
    • 24 Posts
    Hi all,

    i have a question about the TX Newsletter.

    I have installed the plugin, and the plugins does work. But i don’t no, how i can TX Newsletter say that the document with the ID 4 and ID 6 is the newsletter 1 and 2...

    what must i make, that the TXNewletter know, which ID Number the newsletter is?

    Everyone can help me?
      • 32004
      • 24 Posts
      I found it... sorry...

      I search in the PHP Code.. BUt that was the false way...

      Thanks
        • 32004
        • 24 Posts
        Hi, i have another Problem. After i send a newsletter, i have this error:

        Warning: file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /home/httpd/vhosts/stephanstern.ch/httpdocs/v1/assets/modules/txnewsletters/txnewsletters.inc.php on line 1479
        
        Warning: file_get_contents(http://www.stephanstern.ch/v1/index.php?id=4) [function.file-get-contents]: failed to open stream: no suitable wrapper could be found in /home/httpd/vhosts/stephanstern.ch/httpdocs/v1/assets/modules/txnewsletters/txnewsletters.inc.php on line 1479
        Sending done !


        Everyone have some ideas why i have this error? And what i must do..?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          It means that your server is configured so that you can’t get the contents from another web page using a php script. The newsletter script gets the contents of the document you tell it to, but your server won’t let it.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 32004
            • 24 Posts
            But the newsletter get the content from a document with the ID 4 or ID 6 from the modx.

            Newsletter Document ID 3
            - Newsletter 01 ID 4
            - Newsletter 02 ID 6

            I don’t understand what i can, or what i must do it that the newsletter works...

            I’m more the designer, not the coder... wink
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Right. The content of the newsletter is collected from a URL to document # whatever. As long as your server has URL access disabled it won’t work. http://il.php.net/manual/en/filesystem.configuration.php
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 32004
                • 24 Posts
                I have found a solution:

                txnewsletters.inc.php line 1479 from:

                 $html = file_get_contents($url)  


                to:

                 $ch = curl_init();
                $timeout = 5; // set to zero for no timeout
                curl_setopt ($ch, CURLOPT_URL, $url);
                curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
                curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
                $html = curl_exec($ch);
                curl_close($ch);  


                Thats works fine.