Email PDF is empty when rendered from the TicketReceiptMail service.
It seems that the rendering context is empty.

Comments

pcambra created an issue. See original summary.

  • ed8a0e8 committed on 2.x
    Issue #3281570: Email PDF is generated empty
    
pcambra’s picture

Status: Active » Fixed
mattbloomfield’s picture

I'm afraid my PDF is still being emailed as blank. And the QR code isn't showing up in the PDF.

pcambra’s picture

I'm afraid I will need more information about this

mattbloomfield’s picture

So I've got it installed, all dependencies installed since I did it via composer. Symfony mailer has the email going via SMTP, and the PDF is blank and the QR code isn't generated in the PDF. When I run cron, the PDF also pops up before cron finishes (so I have to run cron again to get the email to send).

pcambra’s picture

Status: Fixed » Needs work

Let's tentatively reopen this one.

I've tested it again (and we have an automated test now), is this with logged in orders or anonymous?

mattbloomfield’s picture

It's with both.

pcambra’s picture

We need to review/clarify permissions then?
We have a test that checks the "view own ticket" permission (please ensure you have that one)

This code is the one that ensures that the right user is used for sending the tickets:

https://git.drupalcode.org/project/commerce_ticketing/-/commit/ed8a0e8fb...

I definitely need to look at the mail tests and the qr code tests with permissions...

Any more info you can give me (permissions, etc), or if you find anything new, please let me know, I'll try to look at this tomorrow/Monday

pcambra’s picture

pcambra’s picture

Status: Needs work » Postponed (maintainer needs more info)
elbarcino’s picture

Has anybody found a solution to this problem. I'm running into the same issue...

pcambra’s picture

I still need more information to debug / reproduce this problem

pcambra’s picture

I'm thinking that this might be a permission issue? there's a "Commerce Ticket: Use all print engines" permission that needs to be enabled for the authenticated users to be able to use the entity print module.

mattbloomfield’s picture

I was playing around with this, and I'm not sure if it's a permission issue. To style the ticket, I used views to create a table and insert the QR code there and display it on the node via a viewfield. But the QR code doesn't seem to be able to be generated via views anymore.

pcambra’s picture

Folks, I'm trying to help here, but I need more than vague info to give you an answer :)

imclean’s picture

One thing stands out to me.

@mattbloomfield,

Symfony mailer has the email going via SMTP, and the PDF is blank and the QR code isn't generated in the PDF.

Symfony Mailer provides a completely different way of sending email. Has this been tested with Symfony Mailer?

@mattbloomfield, have you tried sending with any other mail modules?

mattbloomfield’s picture

I've tried with Symfony Mailer. It doesn't work since Symfony Mailer doesn't seem to be able to handle attachments at the moment. I've found that it works with the SMTP module.

I wish I could provide more details, but I'm not exactly sure what you're looking for.

imclean’s picture

My suggestion would be to create a new issue for adding support for Symfony Mailer.

pcambra’s picture

Ah this is fantastic feedback, haven't checked with symfony mailer myself, will do that