Is there a way to CC someone (the admin) on "Welcome (new user created by administrator)"?

Comments

sorensong’s picture

Is there a tpl file somewhere I can insert a cc?

vm’s picture

A tpl.php isn't likely to work since that's theme file and you'd need to insert the email address into a field to be stored into the DB.

http://drupal.org/project/user_register_notify may aid

http://drupal.org/project/rules may also be able to handle a task of this sort though I don't know off hand if an already existing rule is in place. You may have to write a custom rule.

It may also be possible to do this with core's actions and triggers.

sorensong’s picture

How about somewhere in the user.module?

function _user_mail_notify($op, $account, $language = NULL) {
// By default, we always notify except for canceled and blocked.
$default_notify = ($op != 'status_canceled' && $op != 'status_blocked');
$notify = variable_get('user_mail_' . $op . '_notify', $default_notify);
if ($notify) {
$params['account'] = $account;
$language = $language ? $language : user_preferred_language($account);
$mail = drupal_mail('user', $op, $account->mail, $language, $params);
if ($op == 'register_pending_approval') {
// If a user registered requiring admin approval, notify the admin, too.
// We use the site default language for this.
drupal_mail('user', 'register_pending_approval_admin', variable_get('site_mail', ini_get('sendmail_from')), language_default(), $params);
}
}
return empty($mail) ? NULL : $mail['result'];
}