Authentication

 
 
Picture of ces moce
Re: Notify Moodle Admin of NEW USER Registration
 

Hello i m using moodle 2.4 and since i m using this version of moodle i ve trouble withe the email sent after user registration. I m trying to send it to several user. I ve been doing like this on moodlelib but it doesn t work, can somebody helpme?

 

$message = get_string('emailconfirmation', '', $data);
$messagehtml = text_to_html(get_string('emailconfirmation', '', $data), false, false, true);

$user->mailformat = 1; // Always send HTML version as well
$supportuser->mailformat = 1; // Always send HTML version as well
$otheruser->mailformat = 1; // Always send HTML version as well
$otheruser->email = 'email1@mydomain.com';
email_to_user($otheruser, $supportuser, $subject, $message, $messagehtml);
$otheruser->mailformat = 1; // Always send HTML version as well
$otheruser->email = 'email2@mydomain.com';
email_to_user($otheruser, $supportuser, $subject, $message, $messagehtml);
$otheruser->mailformat = 1; // Always send HTML version as well
$otheruser->email = 'email3@mydomain.com';
email_to_user($otheruser, $supportuser, $subject, $message, $messagehtml);
email_to_user($supportuser, $supportuser, $subject, $message, $messagehtml);
return email_to_user($user, $supportuser, $subject, $message, $messagehtml);
}

 

thanks a lot

 
Average of ratings: -