-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Empty PDF voucher #87
Comments
When you say Secondly how is your queue being processed (where Commerce sends the emails), from a web request, automatically, or via the CLI? There should be no real difference between the methods. |
@engram-design It's all just Craft Commerce settings. These are the settings of the e-mail which the PDF is attached to: And this e-mail is sent when an order get status 'New', which is de default order status. So an order gets that status after the payment is done and the order is finished. |
@engram-design |
Okay, thanks. Can you please let me know how your queue is run? The fact that you don't have blank PDFs with run via Commerce > Order tells me that it's a difference when the emails are sent via the queue. Sending the email through the control panel doesn't use the queue, which is why it seems to work. Something must be different in your queue setup. Can you also show me your full Twig template used in your PDF, in case there's something not right there? |
@engram-design I didn't change anything how the queue is going. The queue is automatically running after an order so the e-mail is sent immediately. This is my full twig template:
|
Okay, so the default behaviour is to use a web request, and the queue being sent automatically. Just good to know as sometimes people run the queue from the command line, and that can make a difference. I still can't replicate this, but must have something to do with this not working gift-voucher/src/services/PdfService.php Lines 71 to 80 in 6ec7113
|
@engram-design seeing the same after a Craft 4 update, |
Hmmm, now that would be interesting if things happened in that order. I'm not quite sure how that'd be possible, as I would assume the order needs to be completed before the mail is sent out. Still, that shouldn't be an issue. I'm wondering if you can confirm if there's no codes present in the lines above, by adding: Craft::dd(Code::find()->orderId($order->id)->all()); Because at that point, it can't find any codes for the order, but it can when run later on-demand. |
We where sending the emails our self (not in a queue job) in a custom module in a So I guess our module is getting triggered before your Plugin. Although in Craft 3 it did go fine. |
Describe the bug
I attach a PDF voucher to my order confirmation emails immediately after an order is finished. The PDF voucher is always blank. If I resend the confirmation mail via the admin, the PDF voucher is correct.
It seems that the codes are not found. If I loop through the code, it always shows 'No code found' after the automatic email.
Steps to reproduce
Craft CMS version
3.7.34
Plugin version
2.7.4
Multi-site?
No
Additional context
No response
The text was updated successfully, but these errors were encountered: