-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Fix rendered templates for notifications #48505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me
9501407
to
87276fb
Compare
looks like we need to bump the minimum allowed version of |
87276fb
to
ba1bd59
Compare
46d2f8a
to
bf9aea9
Compare
if (3 === \count($data)) { | ||
if (4 === \count($data)) { | ||
[$this->context, $this->theme, $this->rendered, $parentData] = $data; | ||
} elseif (3 === \count($data)) { | ||
[$this->context, $this->theme, $parentData] = $data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is worth adding a comment as done two lines below or should it be updated to cover this new case?
@@ -67,6 +67,18 @@ public function getContext(): array | ||
return $this->context; | ||
} | ||
|
||
public function isRendered(): bool | ||
{ | ||
return null === $this->htmlTemplate && null === $this->textTemplate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using a boolean property as done in the other class?
Setting those to null
in the next method could lead to inconsistency?
bf9aea9
to
677e188
Compare
677e188
to
085185d
Compare
@@ -76,7 +76,7 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa | ||
$envelope = $event->getEnvelope(); | ||
$message = $event->getMessage(); | ||
|
||
if ($message instanceof TemplatedEmail && ($message->getTextTemplate() || $message->getHtmlTemplate())) { | ||
if ($message instanceof TemplatedEmail && !$message->isRendered()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior seems different here now, the error may be that the template has already been rendered.
Alternative to #48481