mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
Forum mail now logs differently if mail was just blocked (rather than
flagging it as an error)
This commit is contained in:
parent
fd74cb2753
commit
50a26903e6
@ -298,10 +298,16 @@ function forum_cron () {
|
||||
$posttext = forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $userto);
|
||||
$posthtml = forum_make_mail_html($course, $forum, $discussion, $post, $userfrom, $userto);
|
||||
|
||||
if (! email_to_user($userto, $userfrom, $postsubject, $posttext, $posthtml, '', '', $CFG->forum_replytouser)) {
|
||||
echo "Error: mod/forum/cron.php: Could not send out mail for id $post->id to user $userto->id ($userto->email) .. not trying again.\n";
|
||||
add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#$post->id", substr($post->subject,0,15), $cm->id, $userto->id);
|
||||
if (!$mailresult = email_to_user($userto, $userfrom, $postsubject, $posttext,
|
||||
$posthtml, '', '', $CFG->forum_replytouser)) {
|
||||
echo "Error: mod/forum/cron.php: Could not send out mail for id $post->id to user $userto->id".
|
||||
" ($userto->email) .. not trying again.\n";
|
||||
add_to_log($course->id, 'forum', 'mail error', "discuss.php?d=$discussion->id#$post->id",
|
||||
substr($post->subject,0,30), $cm->id, $userto->id);
|
||||
$errorcount++;
|
||||
} else if ($mailresult == 'emailstop') {
|
||||
add_to_log($course->id, 'forum', 'mail blocked', "discuss.php?d=$discussion->id#$post->id",
|
||||
substr($post->subject,0,30), $cm->id, $userto->id);
|
||||
} else {
|
||||
$mailcount++;
|
||||
}
|
||||
@ -469,10 +475,13 @@ function forum_cron () {
|
||||
}
|
||||
$posthtml .= '</body>';
|
||||
|
||||
if (! email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, '', '', $CFG->forum_replytouser)) {
|
||||
if (!$mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml,
|
||||
'', '', $CFG->forum_replytouser)) {
|
||||
echo "ERROR!\n";
|
||||
echo "Error: mod/forum/cron.php: Could not send out digest mail to user $userto->id ($userto->email)... not trying again.\n";
|
||||
add_to_log($course->id, 'forum', 'mail digest error', '', '', $cm->id, $userto->id);
|
||||
} else if ($mailresult == 'emailstop') {
|
||||
add_to_log($course->id, 'forum', 'mail digest blocked', '', '', $cm->id, $userto->id);
|
||||
} else {
|
||||
echo "success.\n";
|
||||
$usermailcount++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user