We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25762
    • 67 Posts
    How hard would it be for me to automagically email a document(s) to a MODx group of users based on role? Can you point me to relevant snippets and/or features? Email doesn’t have to be formatted as HTML; text would be fine.
      • 25762
      • 67 Posts
      No rush but you guys are usually blazing fast wink

      For example, how hard would it be to wire together any ’x’ document for inclusion in the manager mail module (assume it’s a module) for mailing to a group and have it sent to that group without requiring admin involvement? Is anything available already or is it likely to be in the foreseeable future?
        • 7923
        • 4,213 Posts
        I’m pretty sure that with Newsletter snippet you can send modx documents via email to selected users/usergroups.


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 25762
          • 67 Posts
          Yes, I’m confident about that but can I pass documents already created automatically to the Newsletter snippet according to some condition (take the top document from this folder and mail it every morning at 7 AM to ’this’ group). Or, do I need to explicitly assign documents to the Newsletter snippet and manually execute a ’send’?

          For instance, suppose I wanted to create a digest of content each day. I assume I could create a document that auto-aggregated content from the previous day’s documents but can that document be passed to Newsletter (or some other snippet) without admin intervention?
            • 7923
            • 4,213 Posts
            You would have to modify the newsletter snippet to get it send messages automatically.. Another option would be to do a snippet what uses Ditto to build the mail content and send to set users based on usergroups. Then make a plugin that is attatched to some parsing event that runs on every page request, then in that plugin make the scheduling to run your snippet. You can get the code to all this by looking at the newsletter code (exept the plugin).


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 27226
              • 186 Posts
              Quote from: RussLipton at Aug 12, 2006, 01:08 PM

              but can that document be passed to Newsletter (or some other snippet) without admin intervention?
              So, you mean: without a user? Then we have a cron-issue here, I suppose.
              Without a user doing something MODx is doing nothing.
              Correct me if I’m wrong! cool
                • 25762
                • 67 Posts
                Good catch and I should have mentioned it - otherwise, I might just as well cut-paste a document into manager mail and have an admin mail it to a group themselves.
                  • 7923
                  • 4,213 Posts
                  Quote from: silent at Aug 12, 2006, 02:21 PM

                  So, you mean: without a user? Then we have a cron-issue here, I suppose.
                  Yes, cron job would be the best, but if the site has frequent users, plugin attached to parse event can do the scheduling too.


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 4041
                    • 788 Posts
                    The TimedPublisher snippet I’m working on is an example of showing or hiding content based on the getdate() function and could be easily modified to send your mails at a certain time of day.

                    The file is in the Snippet development area, have a look and see if it can help...
                    http://modxcms.com/forums/index.php/topic,6250.0.html
                      xforum
                      http://frsbuilders.net (under construction) forum for evolution
                      • 25762
                      • 67 Posts
                      That code does look interesting, but I don’t see how to modify it to actually send the emails themselves?