本文整理汇总了PHP中feedback_send_email_text函数的典型用法代码示例。如果您正苦于以下问题:PHP feedback_send_email_text函数的具体用法?PHP feedback_send_email_text怎么用?PHP feedback_send_email_text使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了feedback_send_email_text函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedback_send_email_anonym
/**
* sends an email to the teachers of the course where the given feedback is placed.
*
* @global object
* @uses FORMAT_PLAIN
* @param object $cm the coursemodule-record
* @param object $feedback
* @param object $course
* @return void
*/
function feedback_send_email_anonym($cm, $feedback, $course) {
global $CFG;
if ($feedback->email_notification == 0) { // No need to do anything
return;
}
$teachers = feedback_get_receivemail_users($cm->id);
if ($teachers) {
$strfeedbacks = get_string('modulenameplural', 'feedback');
$strfeedback = get_string('modulename', 'feedback');
$strcompleted = get_string('completed', 'feedback');
$printusername = get_string('anonymous_user', 'feedback');
foreach ($teachers as $teacher) {
$info = new stdClass();
$info->username = $printusername;
$info->feedback = format_string($feedback->name, true);
$info->url = $CFG->wwwroot.'/mod/feedback/show_entries_anonym.php?id='.$cm->id;
$postsubject = $strcompleted.': '.$info->username.' -> '.$feedback->name;
$posttext = feedback_send_email_text($info, $course);
if ($teacher->mailformat == 1) {
$posthtml = feedback_send_email_html($info, $course, $cm);
} else {
$posthtml = '';
}
$eventdata = new stdClass();
$eventdata->name = 'submission';
$eventdata->component = 'mod_feedback';
$eventdata->userfrom = $teacher;
$eventdata->userto = $teacher;
$eventdata->subject = $postsubject;
$eventdata->fullmessage = $posttext;
$eventdata->fullmessageformat = FORMAT_PLAIN;
$eventdata->fullmessagehtml = $posthtml;
$eventdata->smallmessage = '';
message_send($eventdata);
}
}
}
示例2: feedback_send_email_anonym
/**
* sends an email to the teachers of the course where the given feedback is placed.
* @param object $cm the coursemodule-record
* @param $feedback
* @param $course
* @return void
*/
function feedback_send_email_anonym($cm, $feedback, $course)
{
global $CFG;
if ($feedback->email_notification == 0) {
// No need to do anything
return;
}
// $teachers = get_course_teachers($course->id);
$teachers = feedback_get_receivemail_users($cm->id);
if ($teachers) {
$strfeedbacks = get_string('modulenameplural', 'feedback');
$strfeedback = get_string('modulename', 'feedback');
$strcompleted = get_string('completed', 'feedback');
$printusername = get_string('anonymous_user', 'feedback');
foreach ($teachers as $teacher) {
unset($info);
$info->username = $printusername;
$info->feedback = format_string($feedback->name, true);
$info->url = $CFG->wwwroot . '/mod/feedback/show_entries_anonym.php?id=' . $cm->id;
$postsubject = $strcompleted . ': ' . $info->username . ' -> ' . $feedback->name;
$posttext = feedback_send_email_text($info, $course);
$posthtml = $teacher->mailformat == 1 ? feedback_send_email_html($info, $course, $cm) : '';
@email_to_user($teacher, $teacher, $postsubject, $posttext, $posthtml);
}
}
}