my hyper link disappeared so here it is again http://docs.moodle.org/en/Administration_hacks and it is number 2 on the list
Thank you for your time.
I checked this hack. It does not work with 1.9+. I did not find in the code mentioned lines. Look...
----------------
Send a duplicate of the registration email to the administrator
In /lib/moodlelib.php, search for the function send_confirmation_email (around line 3629 in 1.8.4+). At the end of the function there is a line that reads (2):
return email_to_user($user, $from, $subject, $message, $messagehtml);
Just before that line, add a line like this:
email_to_user($from, $from, $subject, $message, $messagehtml);-------------------
Do you know how to change this code?
I have a similar problem:
I found the required text in line 4379:
$message = get_string('newusernewpasswordtext', '', $a);
$subject = format_string($site->fullname) .': '. get_string('newusernewpasswordsubj');
return email_to_user($user, $supportuser, $subject, $message);
}
It is not quite the same - so I was not quite sure what to do.
I also want the Emails sent to another address as well as my own but I am unsure how to do this.
Help please
I changed $user to $supportuser and it appears to have worked.
I still can't get it to send the Email to another person...
If you want to send the same email to another additional address, you can add the following lines:
$otheruser = new object();
$otheruser->firstname = 'User Firstname';
$otheruser->lastname = 'User Lastname';
$otheruser->email = 'user@some.email.domain';
email_to_user($otheruser, $supportuser, $subject, $message, $messagehtml);
before the line that reads:
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);
If you want to send it to several people, simply copy & paste the above lines as many times as needed.
Saludos. Iñaki.
That'll work and I think it is a more flexable solution than the well documented one as, (for example) it would allow the school bookkeeper to recieve a notification.
It is noteworthy for the less than completely familiar with php fill in between the ' and'
$otheruser = new object();
$otheruser->firstname = 'User Firstname';
$otheruser->lastname = 'User Lastname';
$otheruser->email = 'user@some.email.domain';
email_to_user($otheruser, $supportuser, $subject, $message, $messagehtml);
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);
Thanks - this is just what I needed.
John
Hi,
I used the folloinwg code and it works fine. However, the admin is reciving un-formatted version of the email (php code rather than HTML). Even when i insert the the mailformat =1 line
Here is my code:
$user->mailformat = 1; // Always send HTML version as well
$otheruser->mailformat = 1; // Always send HTML version as well
$otheruser = new object();
$otheruser->firstname = 'my fisrt name';
$otheruser->lastname = 'my last name';
$otheruser->email = 'sindbad1200@gmail.com';
email_to_user($otheruser, $supportuser, $subject, $message, $messagehtml);
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);
any help please
Turk
hello How to Moodle 1.9.15 + create one admin notification of new registered users. tried all the methods have not worked no more than one ...
Thanks Saludos - just what I needed.
John
You're welcome. Just a little detail: 'saludos' is the Spanish word for 'greetings'. Iñaki is my real name
Saludos. Iñaki.
it stays as is and you put the person who you wish to cc into the places where the code is red
Thank you E.L. for your endless contributions!
תשובה ל: Re: New register user notification to admin's email
I am just asking is there a way to send a formatted notice with new user details to the admin?
Thanks alot!
Re: תשובה ל: Re: New register user notification to admin's email
תשובה ל: Re: תשובה ל: Re: New register user notification to admin's email
I've been doing it before, but I was asking for a more elegant way. I don't want the confirmation email, I want it to email me the details the user has been inserted.
Thanks a lot for support! Your replay is greatly appreciated!
Re: תשובה ל: Re: New register user notification to admin's email
Hello,
I'm wondering if this solution also works in Moodle 2.7?
I've tried implementing it but the email isn't being received by the "otheruser".
Any help would be greatly appreciated.
Many thanks.