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
    Is there a way I can have my MODx powered site send me an email notification when a new user signs up as a Web User, and when a new comment is posted?

    thanks

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


      I send pointless little messages
      • 32847
      • 171 Posts
      Hi,
      I was looking for the same feature when a manager user post an article so I use this topic wink.
      I would like a notification email to the admin.

      Thanks
        • 6726
        • 7,075 Posts
        Not to my knowledge, but it would be nice indeed, +1
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 32241
          • 1,495 Posts
          You can use plugin to do that. Check the name of the event on the documents collection.
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 6726
            • 7,075 Posts
            Wendy, probably crystal clear for code-aware people, but I am not sure what you mean... you mean create a plugin taking advantage of MODx API and event listener ?
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 33337
              • 3,975 Posts
              add sendmail code in plugin, select appropriate events.. THATS IT! wink

              regards,

              zi
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 6726
                • 7,075 Posts
                Ok that’s a little bit clearer but how about a sample code ?

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


                  MODx est l'outil id
                  • 33337
                  • 3,975 Posts
                  Quote from: davidm at Feb 06, 2006, 12:31 PM

                  ....how about a sample code ?...

                  :X
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 32241
                    • 1,495 Posts
                    Sorry I can’t provide a drop in solution, but hopefully my little code can help someone to code for this plugin.

                    Here is the code for the web user save notification.
                    <?php
                    // Set this plugin to listen on "OnWUsrFormSave"
                    global $content;
                    $e = &$modx->Event;
                    
                    switch($e->name) {
                      case 'OnWUsrFormSave':
                        // NOTE:
                        //   - You might need to code soemthing to check whether the the event being 
                        //     called on new user or they are just updating their user information
                        //   - I'm not to for sure whether this event being called on web user
                        //     signup form snippet included on basic installation of MODx though,
                        //     hopefully it is.
                        //   - I NEVER TESTED THE SCRIPT, so be careful in using this :D
                        mail("[email protected]", "Web User Created", "There is a new web users created!");
                        break;
                      default:
                        break;
                    }
                    ?>
                    


                    For the user comment, I’m assuming you’re using the comment snippet. Look for this line "// create new comment page", after that comment, you need to add mail function calling on those snippet to send you an email.
                    // NOTE:
                    //   - I HAVEN'T TESTED THIS YET!
                    mail("[email protected]", "New Comments", $comment);
                    


                    Hope that helps. smiley
                      Wendy Novianto
                      [font=Verdana]PT DJAMOER Technology Media
                      [font=Verdana]Xituz Media
                      • 26435
                      • 1,193 Posts
                      Thanks. I will try it and report back.

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


                        I send pointless little messages