We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17058
    • 80 Posts
    first of all, thanks for the nice snippet.

    i use this snippet on a local installation (XAMPP - MODx 0.9.1 ).
    for testing purposes i copied the same code from wendy’s testserver example. ( of course, i modified the link-ids).
    but, i get a parser error:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’?mode=signup ) AND (sc.privateweb=0) LIMIT 1’ at line 4 »
    SQL: SELECT sc.parent FROM `esoulate`.esoulate_site_content sc LEFT JOIN `esoulate`.esoulate_document_groups dg on dg.document = sc.id WHERE (sc.id=41?mode=signup ) AND (sc.privateweb=0) LIMIT 1

    what’s gone wrong?

    thanks for help, le block
      le_block is Member of FUTY | Medienagentur aus Leipzig mit Schwerpunkt Marketing, Branding, Print und Webdesign
      • 17058
      • 80 Posts
      solved the mysql error.
      obviously, i didn’t create the the document and user group in th right way.
      After creating this, the error message is gone,but i don’t get the newsletter to work.
      I dont’t know to th eprper usage of the the call (or the functionality).

      maybe someone can give me the right hint.
      i wanna have a page(e.g. id=17) where frontenduser (without any registration) are able to sign in a emailadress.
      after preessing the signin-button a page should called (e.g. id=18) with a response text ("thanks for signing in...).
      The backend user (admin) schould be able to write newsletters.

      whats about a link in a received nesletter for unsubscribing the newsletter .surely a link to the cms-page with the unsubscribe call.Am i wrong?
      thanks for help, le block.
        le_block is Member of FUTY | Medienagentur aus Leipzig mit Schwerpunkt Marketing, Branding, Print und Webdesign
        • 28042 ☆ A M B ☆
        • 24,524 Posts
          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
          • 18436
          • 135 Posts
          Hi I tested this snippet last and it worked perfectly for sending text and html newsletters when the snippet is called with &mode=`msg`.

          However when I changed the call to &mode=`doc` I get the following error:

          Fatal error: Call to undefined function curl_init() in C:\WebServer\www\development\swellguys.co.za\manager\includes\document.parser.class.inc.php(691) : eval()'d code on line 391


          Any idea how I can go about correcting this? I’m going to try and setup a test document with a very simple table-based layout and see if I can get it to work since I do some complex templates for all my other pages.
            • 7923
            • 4,213 Posts
            It seems that CURL package is not available in your php installation. The curl_init() function that the error message refers to depends on that package.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 18436
              • 135 Posts
              Hi thanks for the direction, I installed the curl package and got it working. Email does now get sent when using &mode=`doc` but all I receive in the email client is a message containing "1". Any idea what I’ve done wrong?
                • 7923
                • 4,213 Posts
                I haven’t looked into this snippet very much.. what the "doc" mode should do?


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 18436
                  • 135 Posts
                  As far as I know it should send the document I selected as either a text or html email message.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    That sounds like a bug in the snippet; if you use the line "return <some_function()>;" what you’ll get is the return value of that function, not the results of the function. For example, if your snippet includes a file, and you use "return include(’myfile.php’); you’ll get a 1 on your page.

                    I haven’t looked into the newsletter snippet, but that result sounds very much like a similar bug.
                      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
                      • 18436
                      • 135 Posts
                      Thought it might be something like that, has anyone successfully sent a page as an html email using this snippet?