We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4095
    • 372 Posts
    Someone has asked me to help them with a website (creating in MODx) and I need a way to post news information via email. That is, I send the article in an email as plain text (or Markdown) to a special address and it is automatically posted to the website as a news article.

    Of course I would need to form the email in a certain way so MODx would know how to handle it, including username and email to ensure the sender had permission.

    I know this seems like a strange thing to do but I am going to need to post it over a satellite link in remote part of the world and may not have time / bandwith to access the HTML site.

    Anyone got ideas?
      [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
      Admin Sandbox Login: sandbox Password: castle
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Well, first you need to have a way to access the email. I don’t believe you can do that from PHP; you’ll need a server script that gets the email from the server’s incoming mailbox, then makes it available to your webspace php script. There are probably Perl script that do this; you would need to work with the database directly, checking the sender’s email and perhaps a password in the subject, with the user tables, then format the email message and load it into the site_content field.
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        It looks like this might do the job, you could use it to write the mail as an html file to a given folder, then use a snippet to include the file in your document’s content, or use a module for a manager user to load the file into the site_content table.

        http://www.oac.uci.edu/indiv/ehood/mhonarc.html#whatis
          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
          • 6726
          • 7,075 Posts
          This is not so unreasonnable, I know some blogging tools allow this kind of thing, we had request @Textpattern about this, but I don’t remember which... I’ll try to find it back and post here.
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l'outil id
            • 14267
            • 113 Posts
            Coincidentally, a class called "PHP Email To DB" was just included in today’s phpclasses.org digest. Uses the PHP IMAP extension. I haven’t looked at it, but maybe it’s what you need.

            http://www.phpclasses.org/browse/package/3324.html
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: jlarson at Aug 29, 2006, 10:22 AM

              Coincidentally, a class called "PHP Email To DB" was just included in today’s phpclasses.org digest. Uses the PHP IMAP extension. I haven’t looked at it, but maybe it’s what you need.

              http://www.phpclasses.org/browse/package/3324.html
              I think that class is a little overkill for the purpose of posting articles via email, but a similar approach might work.
                • 4095
                • 372 Posts
                Hey cool, I thought this was going to be in the too hard / impossible box. Again I am inspired by the MODx community and the ability to find solutions to any problem presented.
                  [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                  Admin Sandbox Login: sandbox Password: castle
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I always like a good puzzle. Maybe I should map one of the buttons on my hot-shot mouse to automatically load Google!
                    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
                    • 16987
                    • 11 Posts
                    Are there any suggestions now, for the easiest way to do it?

                    I just want to have some Webusers for changing some articles and these should only get the permission to send articles via E-Mail (just cheking the absender adress has the permission) to one folder in - it is just for articles about sportcompetitions, there are allready writing these articles to the press via email and the articles should also appear on our club-homepage. So for the webusers there will be no more work about it (logging in to the website and creating the article). And I can change the clubhomepage from joomla >:( to ModX. grin.

                    Thanks in advance.