We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39727
    • 2 Posts
    I am building a new site where I need to do the following:

    1. Periodically Import a list of users from a csv file, register them to a specific group and send a mail to these users with a generate password link.

    2. Periodically update existing user details using a csv file and add them to a new group.

    Is this possible within Modx core (Evo or Revo) or can some one suggest a module / plugin for the same...
      • 3749
      • 24,544 Posts
      This is definitely doable in either version but would probably take a custom snippet that you would have to write. I think it would be easier in Revolution.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 39727
        • 2 Posts
        Thank you... Kindly guide me in the right direction, maybe towards a tutorial.
          • 3749
          • 24,544 Posts
          I don't know of a tutorial, but I did find this package for Revolution:

          http://modx.com/extras/package/importusersx

          I've never used it, but if it doesn't do what you want, the code might get you started.

          There is also this bit of code I wrote for someone a while back: https://forums.modx.com/?action=thread&thread=72179.

          It only writes usernames and passwords and puts the user in a usergroup. If you need to set user details beyond username and password, it gets a little more complex because they are in a different table.

          For example, to set the fullname and email fields, you'd do something like this(after creating the $user $object):

          <?php
          $profile = $modx->newObject('modUserProfile');
          $profile->set('fullname', $fullName);
          $profile->set('email', $email);
          $user->addOne($profile);
          $user->save();



          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting