MDL-52969 mod_forum: Add List-Unsubscribe email header
authorBrendan Heywood <brendan@catalyst-au.net>
Tue, 9 Feb 2016 13:24:17 +0000 (00:24 +1100)
committerBrendan Heywood <brendan@catalyst-au.net>
Thu, 11 Feb 2016 09:41:58 +0000 (20:41 +1100)
mod/forum/lib.php

index 4212b75..ff838e1 100644 (file)
@@ -795,6 +795,9 @@ function forum_cron() {
                         $canreply
                     );
 
+                $userfrom->customheaders[] = sprintf('List-Unsubscribe: <%s>',
+                    $data->get_unsubscribediscussionlink());
+
                 if (!isset($userto->viewfullnames[$forum->id])) {
                     $data->viewfullnames = has_capability('moodle/site:viewfullnames', $modcontext, $userto->id);
                 } else {