Email Notification for each course enrollment

Re: Email Notification for each course enrollment

by Mauro Villoldo -
Number of replies: 3

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 that 

thank you very much!


Mauro.



In reply to Mauro Villoldo

Re: Email Notification for each course enrollment

by Nishant Pandya -

Hi Mauro Villoldo, I can't find out where am I put this code. May you please help me where am I put this code, I need this same functionality.

Thanks,

Nishant

In reply to Nishant Pandya

Re: Email Notification for each course enrollment

by Mauro Villoldo -

Hi there Nishant Pandya, I'm sorry but I'm still unable to resolve this issue, we need someone with dev skills.

After hours of investigation and internet search, this code is the best solution I could find but I was unable to make it work.

If you find any other information please let me know.

I will let you know as well...

What I don't understand is why this functionality is not required by the rest of Moodlers or admins or teachers, I mean, how users or students know they have a pending course or that they have been invited to a course.


Thank you very much and I'm sorry I wasn't able to help.


Mauro Villoldo.


In reply to Mauro Villoldo

Re: Email Notification for each course enrollment

by Nishant Pandya -

Yes, same how users or students get notification that they are enrolled for any course.

Thanks Mauro Villoldo, thanks a lot for quick reply. 

Guys please help.

Thanks,

Nishant