ConfirmRegister
Last updated Sep 3rd, 2026 | Page history | Improve this page | Report an issue
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.
Backers
Budget
$194 per month—let's make that $500!
Learn moreWhat 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.
Usage¶
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:
[[!ConfirmRegister]]
An example Register snippet call with activation would look like this:
[[!Register?
&activationEmailTpl=`myActivationEmailTpl`
&activationEmailSubject=`Please activate your account!`
&activationResourceId=`26`
]]
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.
Set activePage when you want a friendly landing page for people who open the activation link a second time (account already active). Set redirectBack or redirectTo when you need to send them somewhere after a successful confirm (checkout, membership form, and so on).
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. | |
| redirectBack | Optional. Resource ID for the post-confirm redirect when redirectTo is empty. Can also be sent in the confirmation link / request (for example from a form that required registration). |
|
| redirectBackParams | Optional. Query parameters for redirectBack (JSON snippet property, or a value from the confirmation request). Used when redirectParams is empty. |
|
| redirectUnsetDefaultParams | Optional. If true, do not merge Register persist parameters (username, userid, and leftover query args) into the redirect URL. |
0 |
| 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. Resource ID to redirect to when confirmation fails (bad or missing link, user not found, and similar). If empty, MODX shows the site error page. | |
| activePage | Optional. Resource ID to redirect to when the activation link is opened again for a user who is already active. If empty, ConfirmRegister uses errorPage (or the site error page). |
Events¶
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¶
- Login.Login
- Login.Profile
- Login.UpdateProfile
- Login.Register
- Login.ConfirmRegister
- Login.ForgotPassword
- Login.ResetPassword
- Login.ChangePassword
- Login.Tutorials
- 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.
Backers
Budget
$194 per month—let's make that $500!
Learn more










