Hi there, I know that this is a old post, but I want to implement this very same functionality
When I manually enrol a user moodle should send him an email to let him know that he has been invited to take a course...
Im using Moodle 2.7
where should I put the code, I mean in wich file and in wich part of the file...
require_once("config.php");
require_once($CFG->libdir.'/moodlelib.php');
function custom_send_mail($to_email_id,$sender_email_id,$subject,$title,$body)
{
$mail = get_mailer(); // This will get the moodle mailer configuration.
$mail-> ....
$mail->send();
}
I have found the last part and I have no problems with thatthank you very much!
Mauro.