Attach Pdf Invoice to Order Delivered Email

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years 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
4 years 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?
4 years 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
4 years ago
This is old, but may interest you

https://www.nopcommerce.com/boards/t/24578/send-pdf-invoice-by-e-mail.aspx
4 years ago
Took me a while to figure my way around this one. Works perfectly now. Thanks so much for your help!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.