MDL-4908 Forum: Add a digest option link to outgoing forum mails

This commit is contained in:
Andrew Nicols
2013-08-13 14:46:11 +01:00
parent 8e08c731eb
commit b28118f673
2 changed files with 16 additions and 6 deletions
+2 -1
View File
@@ -113,7 +113,8 @@ $string['deletedpost'] = 'The post has been deleted';
$string['deletedposts'] = 'Those posts have been deleted';
$string['deletesure'] = 'Are you sure you want to delete this post?';
$string['deletesureplural'] = 'Are you sure you want to delete this post and all replies? ({$a} posts)';
$string['digestmailheader'] = 'This is your daily digest of new posts from the {$a->sitename} forums. To change your forum email preferences, go to {$a->userprefs}.';
$string['digestmailheader'] = 'This is your daily digest of new posts from the {$a->sitename} forums. To change your default forum email preferences, go to {$a->userprefs}.';
$string['digestmailpost'] = 'Change your forum digest preferences';
$string['digestmailprefs'] = 'your user profile';
$string['digestmailsubject'] = '{$a}: forum digest';
$string['digestmailtime'] = 'Hour to send digest emails';
+14 -5
View File
@@ -1033,11 +1033,14 @@ function forum_cron() {
}
}
}
$footerlinks = array();
if ($canunsubscribe) {
$posthtml .= "\n<div class='mdl-right'><font size=\"1\"><a href=\"$CFG->wwwroot/mod/forum/subscribe.php?id=$forum->id\">".get_string("unsubscribe", "forum")."</a></font></div>";
$footerlinks[] = "<a href=\"$CFG->wwwroot/mod/forum/subscribe.php?id=$forum->id\">" . get_string("unsubscribe", "forum") . "</a>";
} else {
$posthtml .= "\n<div class='mdl-right'><font size=\"1\">".get_string("everyoneissubscribed", "forum")."</font></div>";
$footerlinks[] = get_string("everyoneissubscribed", "forum");
}
$footerlinks[] = "<a href='{$CFG->wwwroot}/mod/forum/index.php?id={$forum->course}'>" . get_string("digestmailpost", "forum") . '</a>';
$posthtml .= "\n<div class='mdl-right'><font size=\"1\">" . implode('&nbsp;', $footerlinks) . '</font></div>';
$posthtml .= '<hr size="1" noshade="noshade" /></p>';
}
$posthtml .= '</body>';
@@ -1171,6 +1174,10 @@ function forum_make_mail_text($course, $cm, $forum, $discussion, $post, $userfro
$posttext .= ": $CFG->wwwroot/mod/forum/subscribe.php?id=$forum->id\n";
}
$posttext .= "\n---------------------------------------------------------------------\n";
$posttext .= get_string("digestmailpost", "forum");
$posttext .= ": {$CFG->wwwroot}/mod/forum/index.php?id={$forum->course}\n";
return $posttext;
}
@@ -1224,11 +1231,13 @@ function forum_make_mail_html($course, $cm, $forum, $discussion, $post, $userfro
}
$posthtml .= forum_make_mail_post($course, $cm, $forum, $discussion, $post, $userfrom, $userto, false, $canreply, true, false);
$footerlinks = array();
if ($canunsubscribe) {
$posthtml .= '<hr /><div class="mdl-align unsubscribelink">
<a href="'.$CFG->wwwroot.'/mod/forum/subscribe.php?id='.$forum->id.'">'.get_string('unsubscribe', 'forum').'</a>&nbsp;
<a href="'.$CFG->wwwroot.'/mod/forum/unsubscribeall.php">'.get_string('unsubscribeall', 'forum').'</a></div>';
$footerlinks[] = '<a href="' . $CFG->wwwroot . '/mod/forum/subscribe.php?id=' . $forum->id . '">' . get_string('unsubscribe', 'forum') . '</a>';
$footerlinks[] = '<a href="' . $CFG->wwwroot . '/mod/forum/unsubscribeall.php">' . get_string('unsubscribeall', 'forum') . '</a>';
}
$footerlinks[] = "<a href='{$CFG->wwwroot}/mod/forum/index.php?id={$forum->course}'>" . get_string('digestmailpost', 'forum') . '</a>';
$posthtml .= '<hr /><div class="mdl-align unsubscribelink">' . implode('&nbsp;', $footerlinks) . '</div>';
$posthtml .= '</body>';