Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Self Enrolment API

From MoodleDocs
Revision as of 04:42, 1 December 2016 by Simey Lameze Simey (talk | contribs) (Created page with "==Self Enrolment API== The class ''enrol_self_plugin" contains a set of attributes and methods related to moodle self enrolment plugin implementation. ==Methods== ===get_we...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Self Enrolment API

The class enrol_self_plugin" contains a set of attributes and methods related to moodle self enrolment plugin implementation.

Methods

get_welcome_email_contact()

Find the sender contact details based on enrol_self/sendcoursewelcomemessage setting.

Based on the provided parameters (send option and context) it fetches the contact details and returns the user object that will be used as from address.

This setting can have four possible options:

  1. Do not send Based on ENROL_DO_NOT_SEND_EMAIL setting and represents not sending welcome email to users.
  2. Send from course contact Matches ENROL_SEND_EMAIL_FROM_COURSE_CONTACT constant defined on enrollib and depends of course contacs to be set on $CFG->coursecontact.
  3. Send from key holder Matches ENROL_SEND_EMAIL_FROM_KEY_HOLDER constant and retrieve contact details from the first user with enrol/self:holdkey capability assigned in the course.
  4. Send from no reply address If none of those options above return a contact or if the setting is ENROL_SEND_EMAIL_FROM_NOREPLY, fetch no reply contact for sending.

For more information about all possible sending constants and methods, please see Enrolment API document page.