General developer forum

Sending Enrollment Email to participants on using Enrollment Method Cohort Sync

 
Picture of Julien Boulen
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
Core developers

You can find our modifications on our github.

You can set different message for each methods. It's just a copy-paste from "self" enrol method.

Regards,


 
Average of ratings: Useful (1)
Picture of Sazia Arif
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
 

Thank you for your help Julien.

I am able to send email on Cohort Sync. I have below queries will you please help me out on this.

1) Changes made in enroll/manual/lib.php, where will it get displayed. As I made that changes but the enrollment email is not sent when I used Browse Cohort feature in enroll user popup.

2) If a Participant is added to the Cohort ,after Cohort Sync, how can I send enrollment notification email to newly added participants.

 
Average of ratings: -
Picture of Julien Boulen
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
Core developers
1) It does for us. Do you have set a custom welcome message on your manual enrolments method before use enrol user popup?

2) It already sends a notification email. Doesn't it happen when you add a user in your cohort via site administration / users / cohorts?

 
Average of ratings: -
Picture of Sazia Arif
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
 


1) Yes, I have followed steps mentioned in below link, to send email notification when selecting individual users in enrol popup. This works only in Individual enrol case not in Browse Cohort user case.

https://moodle.org/mod/forum/discuss.php?d=108292#p1285695

Steps:

Add below code in /enrol/manual/ajax.php before echo json_encode($outcome);

require_once($CFG->libdir.'/moodlelib.php');

$body = "You have been enrolled to course"." ".$course->fullname."<br/><br/>"."Please login to start your course."."<br/><br/>"."Thanks,"."<br/>Admin";

email_to_user($user,$USER,'Enrollment Notification','The text of the message',$body);


2) Yes an email notification is getting sent when a user is added in cohort via site administration / users / cohorts

 
Average of ratings: -
Picture of Julien Boulen
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
Core developers

Can you try without this modifications ?

For us, it works fine.


 
Average of ratings: -
Picture of Sazia Arif
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
 

I tried commenting below line in enrol/manual/ajax.php , still its not working.

email_to_user($user,$USER,'Enrollment Notification','The text of the message',$body);


Can you please share a snapshot of the page where this modification will be visible.

 
Average of ratings: -
Picture of Julien Boulen
Re: Sending Enrollment Email to participants on using Enrollment Method Cohort Sync
Core developers

When you use enrol popup, if notifications are sent with "browse users" option, there is no reason that it doesn't work with "browse cohorts" because Moodle enrols each users from selected cohort with "manual enrolments" method.

So, in both case, it's the same part of source code that is executed.

The only visible modified thing is here :



But if you are already notified for manual enrolments, I think your settings are good.

Maybe you have others modifications that run in conflict with our changes. But if you have these 4 lines, messages must be sent.

Regards,

 
Average of ratings: -