From 9370179c15492a785cfd0ada3ebb0b9f4b1fdb04 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 9 Dec 2019 17:21:53 +0100 Subject: [PATCH] [Mailer] Mentioned the getMessageId() method --- mailer.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mailer.rst b/mailer.rst index acf196c0ebc..fc19a02e914 100644 --- a/mailer.rst +++ b/mailer.rst @@ -271,6 +271,17 @@ provides access to the original message (``getOriginalMessage()``) and to some debug information (``getDebug()``) such as the HTTP calls done by the HTTP transports, which is useful to debug errors. +.. note:: + + Some mailer providers change the ``Message-Id`` when sending the email. The + ``getMessageId()`` method from ``SentMessage`` always returns the definitive + ID of the message (being the original random ID generated by Symfony or the + new ID generated by the mailer provider). + + .. versionadded:: 4.4 + + The ``getMessageId()`` method was introduced in Symfony 4.4. + The exceptions related to mailer transports (those which implement :class:`Symfony\\Component\\Mailer\\Exception\\TransportException`) also provide this debug information via the ``getDebug()`` method.