@dgwolf I understand what you want to do. For my understanding n Drupal Commerce, invoices and order confirmations are generally triggered when an order is placed. This is because the initial invoice email is meant to confirm the order, so manual payment status updates (like marking a payment as βreceivedβ) don't typically resend the invoice.
To send the invoice upon a manual payment update, you would need to customize the workflow to specifically check for payment status changes and trigger the email logic accordingly.
So this would be another special customization which has to be implemented.
Unfortunately - at the moment - we don t have resources for setting up and debugging this scenario.
@dgwolf
I just tested this again and the emails with invoices also go out after you have created an order manually. May I ask if you also placed the order? Of course, the emails will only be sent out once the order has been placed. That's the trigger. So after creating a manual order you have to click the Place Order button and everything is working as expected. Thanks
Hi.
I think this should more look like this:
{{ format_date(invoice_entity.getInvoiceDateTime.value, 'custom', 'd.m.Y') }}
Maybe you can try.
best regards
Hi there.
Just to report back...
We can confirm that. We also had no problems with 10.2.x. Only after upgrading to 10.3.x the PDF was no longer attached.
So this really seems to have something to do with changes made in 10.3.x Core.
I have applied the commerce_invoice_no_invoice_duplicate_mail.patch indicated in #22 but now I get following error message:
Connection to "process /usr/sbin/sendmail -bs" has been closed unexpectedly.
Is there a problem with the patch as I applied it on version 8.x-2.0-rc5 and not on 8.x-2.0-rc1?
Or could the symfony_mailer 1.5.0 be the cause of the initial problem after update and should I downgrade back to 1.4.1?Or can it have anything to do with the mailer configuration of my website (although it worked before and I didn't change anything?)
For me this sounds like a config error with your sendmail path or sednmail config.
Which module do you use for this?
In our setup we use
https://www.drupal.org/project/symfony_mailer_lite β
without any problems.
Our sendmail path is /usr/sbin/sendmail -t.
Maybe you can instead checkout another transport type like smtp and see if this is working for you?
Hi.
Here s an updated version ob #17 fixing the above plus some improvements.
This patch resolves the issue of duplicate invoice emails being sent in the commerce_invoice module, particularly during payment transitions like PayPal. It also ensures that the invoice PDF is correctly attached to the email.
Key Fixes:
β’ Prevents duplicate emails by introducing a send_email_sent flag, ensuring each invoice email is sent only once.
β’ Moves email sending directly into the markInvoiceForEmailSending() method, improving reliability and avoiding the use of destruct().
β’ Triggers email on specific events, including when an order is marked as pending (for bank transfers) or paid (for PayPal).
β’ Attaches the invoice PDF to the email reliably.
This patch improves overall email handling and ensures invoices are correctly delivered with their attached PDF, without duplicates.
For us this is working so fa now :-)
Thanks
Hi there.
We have the same issue here.
We patched with #15 which attaches the Invoice on prepaid payment gateways. Everything is fine.
But now when some customer uses Paypal the invoice sending is fired twice.
One mail with attached invoice and one without.
I think this is something which is also covered here where this is marked as fixed:
https://www.drupal.org/project/commerce_invoice/issues/3198668 π Order onPaid event called twice RTBC
This is fixed when we use commerce invoice without the patch in #15 but then the invoice pdf is missing.
If we install the patch the invoice mal is fired twice again.
Could this be adjusted?
Thanks for help
Jan
@bircher
Yes. Exactly this.
netzkombuese β created an issue.
netzkombuese β created an issue.