MDL-48061 mod_forum: Tidy up reply-by-email information in emails

* Add a reminder to remove the original message; and
* Remove the reply-to address from the text.
This commit is contained in:
Andrew Nicols 2014-11-05 08:45:46 +08:00
parent 1008dd8ef0
commit 6a5b087163
2 changed files with 12 additions and 4 deletions

View File

@ -115,6 +115,7 @@ $string['delete'] = 'Delete';
$string['deleteddiscussion'] = 'The discussion topic has been deleted';
$string['deletedpost'] = 'The post has been deleted';
$string['deletedposts'] = 'Those posts have been deleted';
$string['deleteoriginalonreply'] = 'If replying directly to this via email, please do not include a quoted copy of the post you are responding to';
$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 default forum email preferences, go to {$a->userprefs}.';
@ -406,8 +407,7 @@ $string['repliesmany'] = '{$a} replies so far';
$string['repliesone'] = '{$a} reply so far';
$string['reply'] = 'Reply';
$string['replyforum'] = 'Reply to forum';
$string['replytoforumpost'] = 'Reply via email to {$a}';
$string['replytoforumpost_html'] = '<a href="mailto:{$a}">Reply via email</a>';
$string['replytoforumpost'] = 'You can reply to this forum post by email.';
$string['replytouser'] = 'Use email address in reply';
$string['reply_handler'] = 'Reply to forum posts via email';
$string['reply_handler_name'] = 'Reply to forum posts';

View File

@ -1186,6 +1186,10 @@ function forum_make_mail_text($course, $cm, $forum, $discussion, $post, $userfro
$posttext = '';
if ($replyaddress) {
$posttext .= "--" . get_string('deleteoriginalonreply', 'mod_forum') . "--\n";
}
if (!$bare) {
$shortname = format_string($course->shortname, true, array('context' => context_course::instance($course->id)));
$posttext = "$shortname -> $strforums -> ".format_string($forum->name,true);
@ -1237,7 +1241,7 @@ function forum_make_mail_text($course, $cm, $forum, $discussion, $post, $userfro
$posttext .= ": {$CFG->wwwroot}/mod/forum/index.php?id={$forum->course}\n";
if ($replyaddress) {
$posttext .= "\n\n" . get_string('replytoforumpost', 'mod_forum', $replyaddress);
$posttext .= "\n\n" . get_string('replytoforumpost', 'mod_forum');
}
return $posttext;
@ -1282,6 +1286,10 @@ function forum_make_mail_html($course, $cm, $forum, $discussion, $post, $userfro
$posthtml .= '</head>';
$posthtml .= "\n<body id=\"email\">\n\n";
if ($replyaddress) {
$posttext .= "<p><em>--" . get_string('deleteoriginalonreply', 'mod_forum') . "--</em></p>";
}
$posthtml .= '<div class="navbar">'.
'<a target="_blank" href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'.$shortname.'</a> &raquo; '.
'<a target="_blank" href="'.$CFG->wwwroot.'/mod/forum/index.php?id='.$course->id.'">'.$strforums.'</a> &raquo; '.
@ -1295,7 +1303,7 @@ 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);
if ($replyaddress) {
$posthtml .= "<p>" . get_string('replytoforumpost_html', 'mod_forum', $replyaddress) . "</p>";
$posthtml .= html_writer::tag('p', get_string('replytoforumpost', 'mod_forum'));
}
$footerlinks = array();