We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26435
    • 1,193 Posts
    I finally got around to learning PHP, and having notification of new comments on my blog sent to my email has been something I have wanted for a while. If you want something, sometimes you have to do it yourself!

    This is a beta release of a modification to the MODx UserComment snippet. Use at your own risk.
    This version of UserComments functions exactly like version 1.1, but adds the ability to be
    notified by email when a new comment is posted. You set the email address to be sent to like
    this:

    [!UserComments? &notify=`[email protected]`!]

    in your &formtpl chunk, you must add the following hidden input:

    <input type="hidden" name="send" value="true" />

    the following input names are can be specified in your form template:

    <input name="commentname" type="text" /> - the name of the person posting.
    <input name="email" type="text" /> - the email of the person posting.
    <input name="subject" type="text" /> - the subject of the post.
    <textarea name="comment" cols="50" rows="8"></textarea> - the content of the post.

    this snippet will look for the names commentname, email, subject, and comment to format the notification email. The URL of the page that the comment was posted to will also be displayed in the email.

    I heavily commented every modification I made to the snippet, You can search for "*** scottydelicious" to see what I changed. This works pretty slick on my site, so if you have a chance to try it out and see if it works, let me know.

    later

    -sD-
      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
      All of the above... in no specific order.


      I send pointless little messages
      • 6726
      • 7,075 Posts
      Those are great additions, Scotty, pretty much essential indeed...
      thanks a lot I’ll try this one out as soon as possible !

        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l&#39;outil id
        • 25663 MODX Staff
        • 12,272 Posts
        ScottyD rocks PHP now, too. laugh

        Thanks for this, as it’s just what UserComments needs. I smell a 0.9.2 feature. wink
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 26435
          • 1,193 Posts
          You’re welcome. I didn’t believe that I am the only one who could find this feature useful. If anyone here who is a true PHP programmer (I consider myself a pseudo-programmer, one step below novice) can take a look at the code I added and make suggestions on how it could be cleaned up, improved, or simplified, please let me know. Also, anyone who tries this snippet, would you post if it worked or didn’t work.

          -sD-
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 25762
            • 67 Posts
            Awesome!

            How about email notification to authors (or groups), optionally, of any document or selected set of documents, upon creation or (optionally) update?

            My audience (Grandad, Mom and Bro) goes online tons but has just become thoroughly comfortable with email - and prefers it still to that confusing ’RSS’ stuff, silly ones. They only check websites once a week or so (I exclude their looks at CNN, Drudge and ESPN). That’s true for Dilbert’s boss and co-workers too (or, at least those for whom they make ’products’).

            TextPattern has just had a really cool plug-in added for ’newsletterish’ notification; nearly making TxP the ideal tool for me .... if only it had groups/membership. I think email notifications of all kinds (including doc content when desired) is a killer enabling feature for juicing end-user centered ModX applications; esp. community applications.
              • 26435
              • 1,193 Posts
              Quote from: RussLipton at Mar 25, 2006, 02:29 PM


              TextPattern has just had a really cool plug-in added for ’newsletterish’ notification; nearly making TxP the ideal tool for me .... if only it had groups/membership. I think email notifications of all kinds (including doc content when desired) is a killer enabling feature for juicing end-user centered ModX applications; esp. community applications.

              NewsLetter Snippet:
              http://modxcms.com/forums/index.php/topic,2421.0.html
                Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                All of the above... in no specific order.


                I send pointless little messages
                • 15987
                • 786 Posts
                Scotty,
                I really like this addition to the snippet. One thing I can think of to add that might be nice, is to only send an email after a certain interval. That way if you get a page that is getting a ton of comments you dont have to recieve an email after every one.

                But none the less, great work.

                Kyle

                p.s. I will let you know when I have this working on my site.
                  • 18397
                  • 3,250 Posts
                  Scotty, here is UserComments 1.3 based on your version with a bit of code refactoring so that it works with all configurations of MODx.
                    • 15987
                    • 786 Posts
                    I finally got around to putting this into my site and am having a small issue. The link in the email seems to be doing something strange. It outputs the link like the following:

                    New comment on http://www.muddydogpaws.com/notebookhttp://www.muddydogpaws.com/new-website-design


                    The link for the comment should have been: http://www.muddydogpaws.com/notebook/new-website-design

                    Any ideas on how to fix this?

                    Just getting the notification is great though!

                    Thanks
                    Kyle

                    P.S. I am using the code posted today by Mark
                      • 18397
                      • 3,250 Posts
                      How are you calling UserComments?