We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4041
    • 788 Posts
    Try looking in the assets/modules/txnewsletters/txnewsletters.inc.php

    Around line 1731, find this line:
    $link = $modx->makeUrl($modx->TXNewsletters[’idPageSubscribe’],"", "", "full").’?&action=confirm&control=’.$MD5."&".$query;

    try removing the ? before &action and see if that helps with the 404 error.

    EDIT:
    The above would probably work fine if you are not using friendly url’s, maybe this would work better:

    find the line noted above, comment it out and add these lines in its place.

    $seperator = ($modx->config['friendly_urls'] =="1") ? "?" : "&";
    $link = $modx->makeUrl($modx->TXNewsletters['idPageSubscribe'],"", "", "full").$seperator.'action=confirm&control='.$MD5."&".$query;

      xforum
      http://frsbuilders.net (under construction) forum for evolution
      • 9130
      • 171 Posts
      Yes, checking friendly urls should work, simply checking for the existence of a ’?’ in the url would be an even more general solution.
      The confirmation function was only tested in a very simple deployment, one newsletter and no options. Although it was designed as a general solution you may run into bugs if you are doing something more complicated.

      If someone has a version with all the fixes please upload it to the modx extras repository as we still have the old 0.9 version there.
        • 19309
        • 49 Posts
        Quote from: Breezer at Nov 07, 2009, 08:04 PM

        find the line noted above, comment it out and add these lines in its place.

        Thanks! That’s it. Now it works.
          • 19309
          • 49 Posts
          Quote from: etal at Nov 08, 2009, 02:13 AM

          If someone has a version with all the fixes please upload it to the modx extras repository as we still have the old 0.9 version there.

          OK, I packed the version I currently use into a ZIP archive and attach it to this post. However, I don’t dare uploading it to the repository yet, because I’m not a developer, can just barely read PHP and didn’t really test this version. If someone with real PHP skills would like to test it and upload it to the repository, that would be fine. By the way, I didn’t touch any of the version numbers in the attached files. These should be changed appropriately before uploading the package to the repository.

          The attached ZIP file includes

          TXNewsletters 0.9, with the following extensions and fixes



          Wish list

          I would really like to contribute to development of TXNewsletters, since I tested a lot of newsletter scripts during the last days. And at least for me TXNewsletters turned out to be the easiest solution for my clients who use MODx. Things like phplist or OpenEMM have a lot more fancy features, but I can’t expect my clients to put up with those rather complicated and feature packed backends. TXNewsletters does just what it should do and is quite easy to use.

          Nevertheless my wish list is quite long:


          • Option to send HTML and/or plain text e-mails.
          • Option for an unsubscribe link which leads directly to the “You are now unsubscribed” page – without any further inquiry in between.
          • A way to personalize e-mails.
            Something like “Dear {Firstname}” in the newsletter template would be replaced with “Dear John” in the final e-mail. This includes the need of some if-then-functionality for gender-specific German formal salutation (if recipient is female, then use “Sehr geehrte Frau {Lastname}”, but if recipient is male, then use “Sehr geehrter Herr {Lastname}”)
          • Option to automatically send a welcome e-mail to every new subscriber after the confirmation process is finished.
            Background: Right now I have a customer who wants to send a coupon to every new newsletter subscriber. This coupon could be included in the e-mail. A printout of the welcome e-mail could then be used as “verification” in the store.

          Unfortunately I just dipped no more than one toe into the waters of PHP. So right now I’m not able to develop all these fancy extensions of the module sad

          But if I can help with things like documentation, please let me know. I just think that I have not completely wrapped my head around how the module works wink
            • 19309
            • 49 Posts
            I know it is a stupid PHP beginner’s question, so please forgive me that wink

            I need to display the e-mail address on the confirmation page, i. e. the page which one sees after clicking the confirmation link in the conformation e-mail. The e-mail address is part of the URL, but right now I have no idea how to display it. I had a look at the unsubscribe-confirmation page, where the e-mail address is also displayed. But just using the same code for the confirmation page, too, doesn’t work.

            Could anybody please give me this little PHP hint? Thanks a lot.
              • 9130
              • 171 Posts
              You should be able to read the email from the query string:
              var $email = $_GET['Email'];

              and use it as you wish.
                • 19309
                • 49 Posts
                Thank you very much etal. It works. (A PHP book is already on my wishlist for christmas, so I don’t have to ask things like that in the future wink )
                  • 23183
                  • 102 Posts
                  Can anyone help me with this error. I did have TXNewsletter working alongside Anything rating fine yesterday. But now when I click the stars to rate an object using anything rating I get this error refering to TXNewsltters huh

                  « MODx Parse Error »
                  MODx encountered the following error while attempting to parse the requested resource:
                  « PHP Parse Error »
                   
                  PHP error debug
                    Error: 	Invalid argument supplied for foreach()	 
                    Error type/ Nr.: 	Warning - 2	 
                    File: 	mysite/assets/modules/txnewsletters/txnewsletters.inc.php	 
                    Line: 	630	 
                    Line 630 source: 	foreach($modx->TXNewsletters['fields'] as $id => $field) { 	 
                   
                  Parser timing
                    MySQL: 	0.0062 s	(16 Requests)
                    PHP: 	0.0836 s
                  
                  


                  Trying to think what I have changed since its started bringing up this error, only significant thing I can think of is turing on Friendly URLs. Could the error be related to that?

                  Many thanks.

                  EDIT: I just turned of Friendly URLs and anything rating didnt bring up the error so it was that causing it.

                  What do I need to change in txnewsletters.inc.php to use it with FURLs?

                  Thanks
                    • 23183
                    • 102 Posts
                    Sorry to bump this, but Im getting know where with it..

                    Can anyone help me out? I dont get the error when I turn friendly URLs off, but I wnat to use them.

                    Thanks
                      • 9130
                      • 171 Posts
                      Normally TXNewsletters works just fine with friendly urls, there is nothing special you need to set.

                      Try looking at what Anything rating is doing to cause this.