Jump to main content Jump to doc navigation

What is ConfirmRegister?

ConfirmRegister is a simple snippet that confirms a registration by a User from the Register snippet, when 'activation' in that snippet is set to 1 (the default). It is placed on a separate, "Registration Activated" page.


Register by default requires the User to activate their account before logging in. The Snippet creates the modUser object and sets its "active" field to 0. The User then gets an email with a URL to activate their account with. Once the User visits the page, their account is set to "active=1", and they can then login.

To enable this, you will need to create an Activation page by creating a new Resource, and putting this ConfirmRegister snippet inside of it:


An example Register snippet call with activation would look like this:

   &activationEmailSubject=`Please activate your account!`

This would send the User the email specified in the "myActivationEmailTpl" chunk, with the specified subject line, which will direct the User to the Resource 26 - the Resource you put the ConfirmRegister snippet call in - to activate their account.

Default Properties

ConfirmRegister has some default properties packaged into it. They are:

Name Description Default
redirectTo Optional. After a successful confirmation, redirect to this Resource.
redirectParams Optional. A JSON object of parameters to pass when redirecting using redirectTo.
authenticate Authenticate and login the user to the current context after confirming registration. 1
authenticateContexts Optional. A comma-separated list of contexts to authenticate to. Defaults to the current context.
errorPage Optional. If set, will redirect user to a custom error page if they try to access this page after activating their account.


ConfirmRegister also fires the OnUserActivate plugin event after the User is activated, and passes in a 'user' parameter, which contains the newly-activated modUser object.

See Also

  1. Login.Login
  2. Login.Profile
  3. Login.UpdateProfile
  4. Login.Register
    1. Register.Example Form 1
  5. Login.ConfirmRegister
  6. Login.ForgotPassword
  7. Login.ResetPassword
  8. Login.ChangePassword
  9. Login.Tutorials
    1. Login.Basic Setup
    2. Login.Extended User Profiles
    3. Login.Request Membership
    4. Login.User Profiles
    5. Login.Using Custom Fields
  10. Login.Using Pre and Post Hooks

Support the team building MODX with a monthly donation.

The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.



$0 per month—let's make that $500!

Learn more