1

I'm trying to figure out whether it's possible to utilize the built-in joomla messaging system to notify admins when a new user registers?

I'm trying to find the function which sends messages, so I can incorporate that into a custom registration component, but I can't seem to find it, or documentation about it.

If someone could point me in the right direction, that would be awesome :)

2 Answers 2

1

This sends a private message (including email notification) to all super users.

// Include classes.
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_messages/models', 'MessagesModel');
JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_messages/tables');

// Get the model.
$model = JModelLegacy::getInstance('Message', 'MessagesModel', array('ignore_request' => true));

// Send a message to super users.
$model->notifySuperUsers($subject, $message);

Note that the email delivered contains generic "new message" text. If you want a custom message like notifying about new user registration, you'll probably have to find a different method.

1

If you use the ACYMail extension on your site you could use its notification configuration to send a an email to whoever you like, including a list of addresses. You would need to set it up for a new user to auto subscribe to a list, a dummy list if you like, just to trigger the notification on registration/subscription.

An additional part of the solution that may or may not work with your custom registration is to use the ACYMail plugin that allows you to override the default Joomla emails with your own custom emails. This might address the comment at the end of Sharky's answer.

Neither of above requires any coding but if you don't otherwise use Acymail it is a bloated solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.