Change email at Email-based self-registration with admin confirmation

Change email at Email-based self-registration with admin confirmation

by Nikos Kokkinis -
Number of replies: 1

Hello,


I am using the "Email-based self-registration with admin confirmation" plugin and in the site we are 2 admin how can i choose at which admin the mail (account confirmation ) will come?


Average of ratings: -
In reply to Nikos Kokkinis

Απάντηση: Change email at Email-based self-registration with admin confirmation

by Nikos Kokkinis -

I found the solution

at the folder /var/www/html/moodle/auth/emailadmin

there is:

foreach($admins as $admin) {

                   if (!in_array($admin->username, $errors)) {

                    $result = email_to_user($admin, $supportuser, $subject, $message, $messagehtml);

                   break;

                 }

}

Because i want to send it to at an email that there isn't any user i change the code to this:


 $to= new stdClass();

           $to->firstname="";

           $to->lastname="";

           $to->email="xxxxxx@gmail.com";

           $to->maildisplay=true;

           $to->mailformat=1;// 0 simle text, 1 with html elements

           $to->id=-99;//there isn't user of moodle site

           $to->firstnamephonetic="";

           $to->lastnamephonetic="";

           $to->middlename="";

           $to->alternatename="";

    $result = email_to_user($to, $supportuser, $subject, $message, $messagehtml);

  And it works fine