Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Mailer] require a body renderer only if message has not been rendered yet#48481

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
xabbuh wants to merge1 commit intosymfony:6.2fromxabbuh:issue-48472

Conversation

@xabbuh
Copy link
Member

QA
Branch?6.2
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#48472
LicenseMIT
Doc PR

$message =$event->getMessage();

if ($messageinstanceof TemplatedEmail && ($message->getTextTemplate() ||$message->getHtmlTemplate())) {
if ($messageinstanceof TemplatedEmail && (!$message->getTextBody() &&$message->getTextTemplate() || !$message->getHtmlBody() &&$message->getHtmlTemplate())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Would this be enough?

Suggested change
if ($messageinstanceof TemplatedEmail && (!$message->getTextBody() &&$message->getTextTemplate() ||!$message->getHtmlBody() &&$message->getHtmlTemplate())) {
if ($messageinstanceof TemplatedEmail && (null !==$message->getTextTemplate() ||null !==$message->getHtmlTemplate())) {

Copy link
MemberAuthor

@xabbuhxabbuhDec 5, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think so. Both methods are overwritten in theNotificationEmail class:https://github.com/symfony/symfony/blob/6.2/src/Symfony/Bridge/Twig/Mime/NotificationEmail.php#L158-L174

Copy link
Contributor

@ThomasTrThomasTrDec 5, 2022
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

for me

(null !== $message->getTextTemplate() || null !== $message->getHtmlTemplate())

istrue,$message->getTextTemplate() is@email/default/notification/body.txt.twig and$message->getHtmlTemplate() is@email/default/notification/body.html.twig

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Let me have a look.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

For my issue#48472 this fixes it:

if ($message instanceof TemplatedEmail && (!$message->getTextBody() && $message->getTextTemplate() || !$message->getHtmlBody() && $message->getHtmlTemplate())) {

evertharmeling reacted with thumbs up emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

See#48505 for an alternative fix.

@fabpot
Copy link
Member

See#48505 for an alternative fix.

xabbuh reacted with thumbs up emoji

@xabbuh
Copy link
MemberAuthor

closing in favor of#48505

@xabbuhxabbuh closed thisDec 6, 2022
fabpot added a commit that referenced this pull requestDec 6, 2022
This PR was merged into the 6.2 branch.Discussion----------[Mailer] Fix rendered templates for notifications| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets       |Fix#48472| License       | MIT| Doc PR        | n/aAlternative to#48481Commits-------085185d [Mailer] Fix rendered templates for notifications
@xabbuhxabbuh deleted the issue-48472 branchDecember 19, 2022 07:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

+2 more reviewers

@ThomasTrThomasTrThomasTr left review comments

@NCSantosNCSantosNCSantos left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

5 participants

@xabbuh@fabpot@ThomasTr@NCSantos@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp