我是 Moodle 新手,我想在用户注册新课程时向学生发送电子邮件通知。当课程下添加新主题时,也应通知学生。
当学生完成任务或作业时,通知将发送给课程创建者。请帮我解决这个问题。
AFAIK 注册电子邮件仅适用于自助注册(转到 youradmin/admin/settings.php?section=enrolsettingsself 并勾选底部的复选框。)
不过,手动注册并不简单。这真是可惜:(.
这是创建本地挂钩以允许此行为的教程https://moodle.org/mod/forum/discuss.php?d=201499
D.
在
/enrol/manual/ajax.php
中echo json_encode($outcome);
之前添加以下代码
require_once($CFG->libdir.'/moodlelib.php');
global $CFG;
$courselink = $CFG->wwwroot . "/course/view.php?id=" . $course->id;
$body = "Hi User<br/><br/>"."You have been enrolled to course"." ".$course->fullname."<`enter code here`br/><br/>"."Please login to start your course."." ".$courselink."<br/><br/>"."Thanks,"."<br/>Admin";
email_to_user($user,$USER,'Enrollment Notification','The text of the message',$body);
echo json_encode($outcome);
此代码工作正常,但您能帮我将注册结束日期添加到同一电子邮件中吗?