Skip to content

Commit

Permalink
Merge branch 'wip-mdl-29534-m23' of git://github.com/rajeshtaneja/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_23_STABLE
  • Loading branch information
danpoltawski committed Jan 14, 2013
2 parents 0aa5236 + 20b556a commit 4012fc4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mod/forum/lib.php
Expand Up @@ -720,6 +720,11 @@ function forum_cron() {
$eventdata->contexturl = "{$CFG->wwwroot}/mod/forum/discuss.php?d={$discussion->id}#p{$post->id}";
$eventdata->contexturlname = $discussion->name;

// If forum_replytouser is not set then send mail using the noreplyaddress.
if (empty($CFG->forum_replytouser)) {
$eventdata->userfrom->email = $CFG->noreplyaddress;
}

$mailresult = message_send($eventdata);
if (!$mailresult){
mtrace("Error: mod/forum/lib.php forum_cron(): Could not send out mail for id $post->id to user $userto->id".
Expand Down Expand Up @@ -1011,10 +1016,9 @@ function forum_cron() {
}

$attachment = $attachname='';
$usetrueaddress = true;
// Directly email forum digests rather than sending them via messaging, use the
// site shortname as 'from name', the noreply address will be used by email_to_user.
$mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, $attachment, $attachname, $usetrueaddress, $CFG->forum_replytouser);
$mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, $attachment, $attachname);

if (!$mailresult) {
mtrace("ERROR!");
Expand Down

0 comments on commit 4012fc4

Please sign in to comment.