Viable way to send activation email from Login plugin to different email address

I was looking for a way to send the activation email to another email address that is not the new users main email.
Any thoughts?

I am using:
Login plugin
MODx version 2.7.2

1 Like

You could create a second (hidden) email field with the desired email address in it and use the &emailField property in your call to use that email to send the activation to.

1 Like

Unless I am missing something i believe any email that is put in the field &emailField automatically becomes the primary email for the new user, so that wouldnt work

1 Like

That might be right, didn’t think about that. If that’s the case, you probably have to use &preHooks and call a custom snippet sending an email to your desired address.

1 Like

Not really an answer - but what’s the use case you have in mind? Maybe there’s a better way to go about it.

1 Like

need to have users register for a service and have there accounts not activate until the site owner activates them

1 Like

Thinking about this, the activation link is needed by the admin, to make it easy to activate the user, but the activation email itself doesn’t seem to be necessary.

Just thinking that you could disable the sending of the email to the new user somehow, and grab the activation link in a posthook…then ship an email to the admin with the link and any other info from the registration form that would be useful

Just thinking out loud

1 Like

Some similar threads on the old forum:

There’s also this tutorial in the documentation but I haven’t personally tried that:


If I’m understanding you, you want this: ActivationEmail Plugin.

Just set the Register plugin not to send an email and one will be sent automatically when the admin activates the user. Optionally, you can also have an email sent when the user is deactivated.


thanks, i shall look into those

1 Like

I didn’t know about the ActivationEmail Plugin, which is certainly worth a look. However, my understanding is that it will allow you to automatically send an email when you activate a user, but it will not ensure your administrators are informed of the registration request.

On one site we are managing, we used the &activationEmail parameter of the login.register snippet to send an email to the users administrators. I don’t think login.register can send an email to multiple persons, but in our case, we defined an email address which forwarded the received emails to multiple recipients.

Our login.register snippet call (on the register page) looks like this (I obfuscated the domain name for privacy)::

    &activationEmailSubject=`User registration request` 

As you see, we set &activationEmail=', which receives the request emails and then redirect the emails to our administrators group.

The register.prehook and register.posthook snippets are used by us in order to allow the users to upload a profile picture.


I can’t think of any reason why you can’t use both Register and ActivationEmail. You can leave Register as is to notify the admins, then ActivationEmail will email the new users when the user moderator activates them.


As @bobray says, you will need the ActivationEmail or another solution in order to notify the user that the account was approved/activated.

I don’t think the Modx system or Register has that function at all. Hmm could be wrong on this…

Looks to me like your solution is good, do be careful about the time limitation on the activation link, you’re probably going to want your admins to have a defined period to click, otherwise they would have to log into the manager and manually activate the account…anyway it would slow things down if that link expires

Thanks, that works. As far as i can see the parameter &activationEmail is not in the documentation strangely enough.

1 Like

Agreed, that was my plan

1 Like

This is the relevant code in the Register processor:

if ($activation && !empty($email) && !empty($activationResourceId) && !$moderated) {


I think you will need the user’s email to have them register successfully, but if you don’t set the &activationResourceId property, no email will be sent.

This should stop Register from sending an email:

1 Like