Attach Pdf Invoice to Order Delivered Email

6 months ago
I'm using nopcommerce 4.2. In the admin, order settings menu there is an option to attach Pdf invoices with "order completed" email. Is it possible to change this, such that it refers to the standard "order delivered" email instead?

I assume there is some adjustment to the code required. Can anyone please direct me?

Thanks
6 months ago
Just to clarify, I'm referring to the "shipment.delivered" email where I want to attach the pdf invoice automatically. Any idea on how to achieve this?
6 months ago
You would need to modify the code
The routine that creates the PDF and attaches it to the Order Placed Email is

        protected virtual void SendNotificationsAndSaveNotes(Order order)
In
        nop42\Libraries\Nop.Services\Orders\OrderProcessingService.cs

Copy some of that code into

        public virtual void Ship(Shipment shipment, bool notifyCustomer)
In
        nop42\Libraries\Nop.Services\Orders\OrderProcessingService.cs

Or alternatively into

        public virtual IList<int> SendShipmentSentCustomerNotification(Shipment shipment, int languageId)
in
        nop42\Libraries\Nop.Services\Messages\WorkflowMessageService.cs
6 months ago
This is old, but may interest you

https://www.nopcommerce.com/boards/t/24578/send-pdf-invoice-by-e-mail.aspx
5 months ago
Took me a while to figure my way around this one. Works perfectly now. Thanks so much for your help!