We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23510
    • 168 Posts
    Ok I have a concept of what I want to accomplish but not sure how to do this in MODx.

    I have three user groups - Pending, Registered - FREE, Registered - PAID

    When a user signs up (through webloginpe), they are given Pending status.

    What I need is when a Manager user adds the web user to the "Registered - FREE" group and removes from the Pending group, the web user gets an email notification saying that they are now registered for the free access area. Similarly for "Registered - PAID".

    I know that plugins need to be involved but really unsure of what happens when.

    Any headstart is appreciated.

    Thanks.
      • 3749
      • 24,544 Posts
      I can’t think of any easy way to do that. There’s no event that fires when a user is joined to a group. It’s not a bad idea for a feature request to fire OnUserJoinGroup in the joinGroup() method of the user object or in adduser.php. The user object is not actually saved when that happens and there is no formSave event either that I can find.

      Maybe someone else has a better idea.
        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
        • 27519
        • 275 Posts
        A CMP which lists all (or a subset from a group) users and their groups and capabilities to change that group for a given user.

        The actual group change is done via a PHP processor. In that processor you can send an email via modx email service.
          MODx Revolution / MAMP / OS X
          • 23510
          • 168 Posts
          Ok thanks both of you. Didnt think this would have been that complex.
            • 4041
            • 788 Posts
            Can you clarify which version of MODx you are using, I assume that it is Evolution since you mentioned webloginpe but the above responses look to be for Revolution.

            Also have you found a solution yet?
              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 23510
              • 168 Posts
              Hi, thanks for your response. I’m using Evo 1.04.

              I know what to do conceptually but just need to figure out the modx code.

              This has to be done in the front end and unfortunately not in the manager.

              1. There has to be a page - protected of course - that lists all the Pending users in a table with an Upgrade to Free Access link and a Upgrade to Paid Access link for each user.
              2. Links will be something like upgrade.php?up=free&id=5 or upgrade.php?up=paid&id=5 where id is the user’s id.
              3. That upgrade.php page will contain a snippet that has php code to (a) change the user’s group and removes them from the Pending group, (b) reset the user’s password, then (c) send out an email with a welcome email and their login info.

              I can probably do this on my own but its going to take a long time to figure it all out.