File tree Expand file tree Collapse file tree 2 files changed +7
-78
lines changed Expand file tree Collapse file tree 2 files changed +7
-78
lines changed Original file line number Diff line number Diff line change 13
13
14
14
use League \HTMLToMarkdown \HtmlConverter ;
15
15
use Symfony \Component \Mime \BodyRendererInterface ;
16
+ use Symfony \Component \Mime \Exception \InvalidArgumentException ;
16
17
use Symfony \Component \Mime \Message ;
17
18
use Twig \Environment ;
18
19
@@ -44,7 +45,12 @@ public function render(Message $message): void
44
45
return ;
45
46
}
46
47
47
- $ vars = array_merge ($ this ->context , $ message ->getContext (), [
48
+ $ messageContext = $ message ->getContext ();
49
+ if (isset ($ messageContext ['email ' ])) {
50
+ throw new InvalidArgumentException (sprintf ('A "%s" context cannot have an "email" entry as this is a reserved variable. ' , TemplatedEmail::class));
51
+ }
52
+
53
+ $ vars = array_merge ($ this ->context , $ messageContext , [
48
54
'email ' => new WrappedTemplatedEmail ($ this ->twig , $ message ),
49
55
]);
50
56
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments