<?php $modx->log(modX::LOG_LEVEL_ERROR, 'Group add plugin running');
<?php $profile = $user->getOne('Profile'); $adminemail = $modx->config['registration_admin_email']; if (empty($profile)) { $modx->log(modX::LOG_LEVEL_ERROR,'Could not retrieve profile for user: ' . $user->get('username')); return true; }else{ $placeholders = array( 'username' => $user->get('username'), 'fullname' => $profile->get('fullname'), 'email' => $profile->get('email'), 'password' => $user->get('password'), 'city' => $profile->get('city'), 'state' => $profile->get('state'), 'date' => date('Y-m-d H:i') ); $message = $modx->getChunk('EmailApplicationApprovedTpl',$placeholders); $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->set(modMail::MAIL_BODY,$message); $modx->mail->set(modMail::MAIL_FROM,'[email protected]'); $modx->mail->set(modMail::MAIL_FROM_NAME,'CWM Admin'); $modx->mail->set(modMail::MAIL_SENDER,'CWM Admin'); $modx->mail->set(modMail::MAIL_SUBJECT,'Your Application at CWM has been approved!'); $modx->mail->address('to',$adminemail); $modx->mail->address('reply-to','[email protected]'); $modx->mail->setHTML(true); if (!$modx->mail->send()) { $modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$modx->mail->mailer->ErrorInfo); }else{ $modx->log(modX::LOG_LEVEL_ERROR,'Application success email sent to'. $user->get('username')); } $modx->mail->reset(); }
Are any of the elements used (plugin or chunk) static elements? I've had trouble with static elements in plugins.
Have you checked to make sure mail is still working? (e.g., QuickEmail). Your host may have changed the mail setup.
Double-check that the Plugin is not disabled and is still connected to the event.
I assume that by dumping the cache, you mean you manually deleted all files in the core/cache directory. If not, try that -- and clear your browser cache and cookies for good measure.
Going into PhpMyAdmin and repairing all the tables in the DB can't hurt.
$eventname = $modx->event->name; $modx->log(modX::LOG_LEVEL_ERROR,'System event running = ' . $eventname);
[2012-07-22 14:56:52] (ERROR @ /index.php) `[[+resource]]` is not a valid integer and may not be passed to makeUrl() [2012-07-22 14:56:56] (ERROR @ /connectors/security/group.php) System event running = OnUserBeforeRemoveFromGroup [2012-07-22 14:56:56] (INFO @ /connectors/security/group.php) Removed modUserGroupMember instance with primary key 213 [2012-07-22 14:56:56] (ERROR @ /connectors/security/group.php) System event running = OnUserRemoveFromGroup [2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave [2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave [2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave [2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave [2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupBeforeSave [2012-07-22 14:58:44] (ERROR @ /connectors/security/group.php) System event running = OnUserGroupSave [2012-07-22 14:58:44] (INFO @ /connectors/security/group.php) Removed modUserGroupMember instance with primary key 70
Sometimes System Events and/or processors are added to the core before the code to use them gets created. The addUserToGroup event didn't exist when I wrote the book, so it must be fairly new. The adduser.php processor exists and it does invoke OnUserAddToGroup, but it may be for future use. It's in core/model/modx/processors/security/group/.
if ($this->xpdo instanceof modX) { $this->xpdo->invokeEvent('OnUserBeforeAddToGroup',array( 'groupId' => $groupId, )); }