I was never experiencing this issue. Perhaps, the appropriate background task is run twice. Perhaps, there's some other issue. Could you please add some logging (ILogger) to QueuedMessagesSendTask class in order to debug it?
Log the following information: 1. The time when the task is run 2. The identifiers of sent email and appropriate time
Then we can see (in the log) whether the task is run: once per minute or more often., when an email is sent, it's sent once or twice (by nopCommerce), etc.
I was never experiencing this issue. Perhaps, the appropriate background task is run twice. Perhaps, there's some other issue. Could you please add some logging (ILogger) to QueuedMessagesSendTask class in order to debug it?
Log the following information: 1. The time when the task is run 2. The identifiers of sent email and appropriate time
Then we can see (in the log) whether the task is run: once per minute or more often., when an email is sent, it's sent once or twice (by nopCommerce), etc.
It was something to do with the application pool. Recycling the pool did nothing. I created a new one and stopped the old and the duplicates stopped.
Using version 3.2. This just started happening to us. Interesting to note. We are using multi-store. We have 5 stores running. All of our outgoing emails were being sent 5 times.
After troubleshooting and not finding anything decided to just try and create brand new app pools and see if it would work. It did in fact work for us.
Don't forget when you create new app pools you will probably have to create new sql server logins for the database and you may also have to give permissions to these new app pools to certain folders in the website.
From the installation notes: nopCommerce requires write permissions for the directories and files described below: •\App_Data\ •\bin\ •\Content\ •\Content\Images\ •\Content\Images\Thumbs\ •\Content\Images\Uploaded\ •\Content\files\ExportImport\ •\Plugins\ •\Plugins\bin\ •\Global.asax •\web.config
Next Day. The duplicate email issue is back. No idea why. Maybe we shouldn't be running each store of the multi-store in a different app pool?
Trying a change to the global.asax from a different post
Update one day later. The change to the global.asax didn't work. It appeared to work, but testing later we got multiple emails. Tried putting different multi-stores onto the same app pool. Once again it appeared to work at the start, but after several hours we tested again and duplicate emails are going out.
If anyone has any suggestions, let me know. I may dive into the code and try to find where the issue lies, something I was hoping to avoid.
You might be running the site multiple times, connected to the same database? i.e. on your (localhost) development environment, test, production environment? Then the emailtask gets executed multiple times.
We are running into this issue with multiple emails on our stores. we do not have multi store we have separate azure websites.
Our configuration below.
NopCommerce 3.1 | 3.1 | 3.4 | brand new 3.4 Backed onto an Microsoft SQL Server Virtual machine Separate DB and accounts for each site Websites running under Azure websites instances.
Website 1 - Version 3.1 ShopAll Installed and using Website 2 - Version 3.1 ShopAll Installed and using website 3 - Version 3.4 - Custom theme only website 4 - Version 3.4 - Brand new Other websites not using Nopcommerce unaffected
Testing notes. Website Instances set to 1 All emails work and only send one email. Website Instances set to 3 All email works and only sends one email WHEN nothing/no one else is browsing. Website Instances set to 3 WITH active users (load testing website) hitting the site All email works and sends 2-3 emails.
Once I set it back to a single instance again it works fine.
I know I could set the instance to 1 and its happy days, Although I'd like to take advantage of the schedule multi instance settings within azure since we're running around 16 sites on this account. With 16 sites if we enable a single instance and pump up the CPU/RAM we'd pay more than running a scheduled instance.
We are running into this issue with multiple emails on our stores. we do not have multi store we have separate azure websites.
Our configuration below.
NopCommerce 3.1 | 3.1 | 3.4 | brand new 3.4 Backed onto an Microsoft SQL Server Virtual machine Separate DB and accounts for each site Websites running under Azure websites instances.
Website 1 - Version 3.1 ShopAll Installed and using Website 2 - Version 3.1 ShopAll Installed and using website 3 - Version 3.4 - Custom theme only website 4 - Version 3.4 - Brand new Other websites not using Nopcommerce unaffected
Testing notes. Website Instances set to 1 All emails work and only send one email. Website Instances set to 3 All email works and only sends one email WHEN nothing/no one else is browsing. Website Instances set to 3 WITH active users (load testing website) hitting the site All email works and sends 2-3 emails.
Once I set it back to a single instance again it works fine.
I know I could set the instance to 1 and its happy days, Although I'd like to take advantage of the schedule multi instance settings within azure since we're running around 16 sites on this account. With 16 sites if we enable a single instance and pump up the CPU/RAM we'd pay more than running a scheduled instance.
Cheers Gavin
Hi Gavin,
what do you mean by instances? worker processes? are you using web garden then? I too for the first time have this issue, since yesterday I set the worker processes from 1 to 3, which inprove the performances a lot for more than 20 active users. But I do fear that there could be such weird issues since I do not think NOP support webfarm, neither does it work well with Web Garden...pretty frustrated at the moment.