From 14e4700127a5b2dee88ae7324bc90a7c6db011a9 Mon Sep 17 00:00:00 2001 From: cos Date: Tue, 20 Oct 2020 11:08:47 +0200 Subject: Fix bug overwriting message-id In case a message-id is already set, postman should not touch it. This commit also checks for existing brackets before adding them, due to inconsistence in function usage. --- Postman/PostmanWpMail.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Postman/PostmanWpMail.php') diff --git a/Postman/PostmanWpMail.php b/Postman/PostmanWpMail.php index c108cce..7cd0596 100644 --- a/Postman/PostmanWpMail.php +++ b/Postman/PostmanWpMail.php @@ -65,8 +65,10 @@ if ( ! class_exists( 'PostmanWpMail' ) ) { * @return PostmanMessage */ private function apply_default_headers( $message ) { - $headers[] = 'Message-ID: ' . $this->createMessageId(); - $message->addHeaders($headers); + if(! $message->getMessageId()) { + $headers[] = 'Message-ID: ' . $this->createMessageId(); + $message->addHeaders($headers); + } } /** -- cgit v1.2.3