From ba778cffd744bf0b7113486d0e772fbbe566eb76 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 17 Nov 2014 13:43:02 -0800 Subject: [PATCH] Don't add "To/Cc" to HTML mail bodies if there's no HTML mail body Summary: Ref T6576. This avoids generating almost-empty HTML mail bodies for mail which incorrectly has no HTML body. Test Plan: Generated some mail locally; the specific hook case is a pain for me to hit right now. Will push and dig in if that doesn't fix it. Reviewers: btrahan, chad Reviewed By: chad Subscribers: epriestley Maniphest Tasks: T6576 Differential Revision: https://secure.phabricator.com/D10863 --- .../metamta/replyhandler/PhabricatorMailReplyHandler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php index 1b173fb38d..582e48d7f6 100644 --- a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php +++ b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php @@ -210,8 +210,10 @@ abstract class PhabricatorMailReplyHandler { $body .= $this->getRecipientsSummary($to_handles, $cc_handles); $html_body = $mail_template->getHTMLBody(); - $html_body .= hsprintf('%s', - $this->getRecipientsSummaryHTML($to_handles, $cc_handles)); + if (strlen($html_body)) { + $html_body .= hsprintf('%s', + $this->getRecipientsSummaryHTML($to_handles, $cc_handles)); + } foreach ($recipients as $phid => $recipient) {