Skip to content
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

[4.x]: PDF attached to email shows error msg when first sent #3340

Closed
tigerchick opened this issue Nov 17, 2023 · 4 comments
Closed

[4.x]: PDF attached to email shows error msg when first sent #3340

tigerchick opened this issue Nov 17, 2023 · 4 comments
Labels
bug commerce4 Issues related to Commerce v4

Comments

@tigerchick
Copy link

What happened?

Description

If an order is made then the email that is sent to the customer has a pdf attached. When the order is first made, this pdf only displays "An error occurred while generating this PDF."
If the email is then subsequently sent again through the CP then the pdf is generated correctly.
The pdf is also generated correctly if the "Download PDF" button is clicked in the order backend CP.
The problem only manifests in the automated email sent out when an order is newly created.
I am using Oliver Stark's AsyncQueue plugin (v3.1.0) but I have also tested without (same result).

Craft CMS version

4.5.11

Craft Commerce version

4.3.2

PHP version

8.2.12

Operating system and version

Linux 4.15.0-192-generic

Database type and version

MySQL 5.7.42

Image driver and version

GD 8.2.12

Installed plugins and versions

@tigerchick tigerchick added commerce4 Issues related to Commerce v4 bug labels Nov 17, 2023
@stefanfriedrich
Copy link

Same error here, Craft 4.5.9, Commerce 4.3.2

@stefanfriedrich
Copy link

@tigerchick Did you set runQueueAutomatically to false? Seems to work for us.

@tigerchick
Copy link
Author

tigerchick commented Nov 27, 2023

@tigerchick Did you set runQueueAutomatically to false? Seems to work for us.

Hi @stefanfriedrich , thanks for the suggestion - I have tried that just now but it doesn't seem to have made a difference.
Also I think that setting is overridden by the plugin anyway (to be false): ostark/craft-async-queue#43 (comment)

Incidentally, I should have mentioned that this was working correctly before I updated to commerce 4x (previously on 3x)

@tigerchick
Copy link
Author

I finally tracked down the issue to a template problem. If it's useful to anyone, the template was using an include that made use of craft.app.request.segments|last.
That's all very well on the frontend but clearly was throwing an error when the pdf was generated in the backend upon order status change. Tracked it down using the logs eventually.
This "issue" can be closed and apologies for bringing it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug commerce4 Issues related to Commerce v4
Projects
None yet
Development

No branches or pull requests

3 participants