Skip to content

Commit c28de13

Browse files
committed
[Mime] Add TemplatedEmail::$locale to the serialized props (fixes #52718)
1 parent b85a083 commit c28de13

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Symfony/Bridge/Twig/Mime/TemplatedEmail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ public function markAsRendered(): void
100100
*/
101101
public function __serialize(): array
102102
{
103-
return [$this->htmlTemplate, $this->textTemplate, $this->context, parent::__serialize()];
103+
return [$this->htmlTemplate, $this->textTemplate, $this->context, $this->locale, parent::__serialize()];
104104
}
105105

106106
/**
107107
* @internal
108108
*/
109109
public function __unserialize(array $data): void
110110
{
111-
[$this->htmlTemplate, $this->textTemplate, $this->context, $parentData] = $data;
111+
[$this->htmlTemplate, $this->textTemplate, $this->context, $this->locale, $parentData] = $data;
112112

113113
parent::__unserialize($parentData);
114114
}

src/Symfony/Bridge/Twig/Tests/Mime/TemplatedEmailTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ public function testSerialize()
4343
->textTemplate('text.txt.twig')
4444
->htmlTemplate('text.html.twig')
4545
->context($context = ['a' => 'b'])
46+
->locale($locale = 'fr_FR')
4647
;
4748

4849
$email = unserialize(serialize($email));
4950
$this->assertEquals('text.txt.twig', $email->getTextTemplate());
5051
$this->assertEquals('text.html.twig', $email->getHtmlTemplate());
5152
$this->assertEquals($context, $email->getContext());
53+
$this->assertEquals($locale, $email->getLocale());
5254
}
5355

5456
public function testSymfonySerialize()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy