From 0a2f994263c19bb554a9277a40866a6c14ef30ae Mon Sep 17 00:00:00 2001 From: Steven De Groote Date: Wed, 28 Jun 2017 23:48:06 +0200 Subject: [PATCH] Add List-Unsubscribe header to notification mails --- www.f1technical.net/forum/includes/functions_messenger.php | 8 ++++++++ www.f1technical.net/forum/language/en/email/topic_notify.txt | 1 + 2 files changed, 9 insertions(+) diff --git a/www.f1technical.net/forum/includes/functions_messenger.php b/www.f1technical.net/forum/includes/functions_messenger.php index 526e185..56706b7 100644 --- a/www.f1technical.net/forum/includes/functions_messenger.php +++ b/www.f1technical.net/forum/includes/functions_messenger.php @@ -342,6 +342,14 @@ class messenger { $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); } + + // SDG - Parse the List-Unsubscribe header, if any + if (preg_match('#^(List-Unsubscribe:(.*?))$#m', $this->msg, $match)) + { + $this->extra_headers[] = $match[1]; + $drop_header = '[\r\n]*?' . preg_quote($match[1], '#'); + $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); + } if ($break) { diff --git a/www.f1technical.net/forum/language/en/email/topic_notify.txt b/www.f1technical.net/forum/language/en/email/topic_notify.txt index 20b86ee..92bf858 100644 --- a/www.f1technical.net/forum/language/en/email/topic_notify.txt +++ b/www.f1technical.net/forum/language/en/email/topic_notify.txt @@ -1,4 +1,5 @@ Subject: Topic reply notification - "{TOPIC_TITLE}" +List-Unsubscribe: <{U_STOP_WATCHING_TOPIC}> Hello {USERNAME}, -- libgit2 0.25.0