Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added an "unsubscribe" link to emails

  • Loading branch information...
commit 8f66d49a779fb22a169ede89def93d1985abe5bc 1 parent 28e1e8b
martin authored

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 mod/forum/lib.php
6 mod/forum/lib.php
@@ -905,6 +905,7 @@ function forum_cron () {
905 905
906 906 if ($users = forum_subscribed_users($course, $forum)) {
907 907 $strforums = get_string("forums", "forum");
  908 + $canunsubscribe = ! forum_is_forcesubscribed($forum->id);
908 909
909 910 $mailcount=0;
910 911 foreach ($users as $userto) {
@@ -946,6 +947,11 @@ function forum_cron () {
946 947 $posthtml .= " -> <A HREF=\"$CFG->wwwroot/mod/forum/discuss.php?d=$discussion->id\">$discussion->name</A></FONT></P>";
947 948 }
948 949 $posthtml .= forum_make_mail_post($post, $userfrom, $userto, $course, false, true, false, false);
  950 +
  951 + if ($canunsubscribe) {
  952 + $posthtml .= "\n<BR><HR SIZE=1 NOSHADE><FONT SIZE=1><A HREF=\"$CFG->wwwroot/mod/forum/subscribe.php?id=$forum->id\">".get_string("unsubscribe", "forum")."</A></FONT>";
  953 + }
  954 +
949 955 } else {
950 956 $posthtml = "";
951 957 }

0 comments on commit 8f66d49

Please sign in to comment.
Something went wrong with that request. Please try again.