From e8bbbbd6fac8a1f04bc74e9ada9df2f5ea83eb25 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Mon, 14 Jan 2019 14:52:06 +0100 Subject: [PATCH] [ticket/15931] Fix PM report emails PHPBB3-15931 --- phpBB/language/en/email/report_pm.txt | 2 +- phpBB/phpbb/notification/type/report_pm.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/phpBB/language/en/email/report_pm.txt b/phpBB/language/en/email/report_pm.txt index a101a014ff..a6b8086a9a 100644 --- a/phpBB/language/en/email/report_pm.txt +++ b/phpBB/language/en/email/report_pm.txt @@ -1,4 +1,4 @@ -Subject: Private Message report - "{TOPIC_TITLE}" +Subject: Private Message report - "{SUBJECT}" Hello {USERNAME}, diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index 7e53ffb3ca..444f98270d 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -142,13 +142,16 @@ class report_pm extends \phpbb\notification\type\pm */ public function get_email_template_variables() { - $user_data = $this->user_loader->get_user($this->get_data('reporter_id')); + $user_data = $this->user_loader->get_user($this->get_data('from_user_id')); return array( 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), - 'U_VIEW_REPORT' => generate_board_url() . "mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", + /** @deprecated 3.2.6-RC1 (to be removed in 4.0.0) use {SUBJECT} instead in report_pm.txt */ + 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), + + 'U_VIEW_REPORT' => generate_board_url() . "/mcp.{$this->php_ext}?r={$this->item_parent_id}&i=pm_reports&mode=pm_report_details", ); } @@ -236,8 +239,10 @@ class report_pm extends \phpbb\notification\type\pm */ public function users_to_query() { - return array($this->get_data('reporter_id')); - } + return array( + $this->get_data('from_user_id'), + $this->get_data('reporter_id'), + ); } /** * {@inheritdoc}