Skip to content

Commit

Permalink
Merge branch 'support/3.1' into support/3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
steffunky committed Nov 4, 2024
2 parents 5776052 + 9371bc6 commit 2519456
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/email.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function SetReferences($sReferences)
*/
public function SetInReplyTo(string $sMessageId)
{
$this->AddToHeader('In-Reply-To', $sMessageId);
$this->oMailer->SetInReplyTo($sMessageId);
}

public function SetBody($sBody, $sMimeType = 'text/html', $sCustomStyles = null)
Expand Down
12 changes: 9 additions & 3 deletions sources/Core/Email/EmailLaminas.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
use InlineImage;
use IssueLog;
use Laminas\Mail\Header\ContentType;
use Laminas\Mail\Header\InReplyTo;
use Laminas\Mail\Header\MessageId;
use Laminas\Mail\Message;
use Combodo\iTop\Core\Authentication\Client\Smtp\Oauth;
use Laminas\Mail\Transport\File;
Expand Down Expand Up @@ -374,11 +376,11 @@ public function SetMessageId($sId)
{
$this->m_aData['message_id'] = $sId;

// Note: Swift will add the angle brackets for you
// Note: The email library will add the angle brackets for you
// so let's remove the angle brackets if present, for historical reasons
$sId = str_replace(array('<', '>'), '', $sId);

$this->m_oMessage->getHeaders()->addHeaderLine('Message-ID', $sId);
$this->m_oMessage->getHeaders()->addHeader((new MessageId())->setId($sId));
}

public function SetReferences($sReferences)
Expand All @@ -397,7 +399,11 @@ public function SetReferences($sReferences)
*/
public function SetInReplyTo(string $sMessageId)
{
$this->AddToHeader('In-Reply-To', $sMessageId);
// Note: Laminas will add the angle brackets for you
// so let's remove the angle brackets if present, for historical reasons
$sId = str_replace(array('<', '>'), '', $sMessageId);

$this->m_oMessage->getHeaders()->addHeader((new InReplyTo())->setIds([$sId]));
}

/**
Expand Down

0 comments on commit 2519456

Please sign in to comment.