Closed Jamiul-Bari closed 8 months ago
Hi @Jamiul-Bari,
You make reference to the Reply-To email header, which is already supported by Laravel in the envelope()
function as shown by this snippet in the docs:
return new Envelope(
from: new Address('jeffrey@example.com', 'Jeffrey Way'),
replyTo: [
new Address('taylor@example.com', 'Taylor Otwell'),
],
subject: 'Order Shipped',
);
Judging by what information you gave however, it seems you in fact want the In-Reply-To email header to reference the previous email, also known in some mail clients as email "Threads".
The following code should work for you:
public function headers(): Headers
{
if (empty($this->emailMessageId)) {
return new Headers();
}
return new Headers(
references: [$this->emailMessageId],
text: [
'In-Reply-To' => $this->emailMessageId,
],
);
}
Thanks @Cbrad24
Laravel Version
10.46.0
PHP Version
8.2.16
Database Driver & Version
MySQL 8.0.27
Description
I cannot add a 'Reply-To' header in Mailables since I want to send the email as a reply to a previous mail (I have the message-id of the last mail).
It gives the following error, which I believe should be handled by the framework or mentioned in the docs since I need to use Symfony-specific objects
Steps To Reproduce
create a mailable