Email Quere Wrong Order Nop Commerce 2.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I noticed that if I placed an order and than canceled that order my canceled email notification came to me before my order placed email did.

This is an issue in  the fact that it is sending the newest queued email before the oldest.

Now lets see if we can put this into perspective. If you have a very busy site, customer 'A' places an order and a notification goes into the queue but since your site is so busy before that notification gets sent a bunch of other customers come through and now you are at customer 'Z' which places their order and then the traffic slows down to barely nothing.

Now the notifications start sending. Customer 'Z' gets their notification than Customer 'Y' and so on till you get back down to Customer 'A'

At this point Customer 'A' may not have gotten their notification till hours later where Customer 'Z' got their notification within a very short period of time.

I have come up with a very easy fix/workaround
In this file QueuedMessagesSendTask.cs
Line: 25    var queuedEmails = _queuedEmailService.SearchEmails(null, null, null, null,
                true, maxTries, 0, 10000)
Change that one line to
var queuedEmails = _queuedEmailService.SearchEmails(null, null, null, null,
                true, maxTries, 0, 10000).OrderBy(x => x.CreatedOnUtc);




of course you have  to make sure to include using System.Linq;
other than that there is nothing else to do. this sends the oldest email out first
12 years ago
Thanks for reporting. I'll create a work item.
12 years ago
awesome!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.