How Email Queue Works

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi,
I can go through the code and notice that a new Email Queue is about saving an email in the DB.
However, what is triggering the sending of emails? Can someone refer me to that code part?

Thanks
8 years ago
It is implemented in Nop.Services.Messages.QueuedMessagesSendTask. E-mails are put in queue and sent at intervals. :)
8 years ago
Thanks for your prompt response.

I went through the code and I noticed there is the concept of Scheduled Tasks. Mostly there are some auto-created once I installed the NC.

Question here, with this code:
new ScheduleTask
                {
                    Name = "Send emails",
                    Seconds = 60,
                    Type = "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services",
                    Enabled = true,
                    StopOnError = false,
                },


Does it mean that run this task every 60 seconds?


So, there is the concept of Tasks (ITask).

- ScheduleTaskService basically CRUD for Tasks into the DB.
- At startup, Tasks are run grouped by Seconds(Interval To Run - ITR). Meaning that every group of Tasks having the same ITR would run inside a single TaskThread, correct?
- Tasks would be run every ITR, then Task becomes idle for the amount of ITR, then it starts again, correct?
- Tasks continue to run as long as Application is started up & running?


Best regards
Bilal Haidar
8 years ago
[email protected] wrote:
Thanks for your prompt response.

I went through the code and I noticed there is the concept of Scheduled Tasks. Mostly there are some auto-created once I installed the NC.

Question here, with this code:
new ScheduleTask
                {
                    Name = "Send emails",
                    Seconds = 60,
                    Type = "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services",
                    Enabled = true,
                    StopOnError = false,
                },


Does it mean that run this task every 60 seconds?


So, there is the concept of Tasks (ITask).

- ScheduleTaskService basically CRUD for Tasks into the DB.
- At startup, Tasks are run grouped by Seconds(Interval To Run - ITR). Meaning that every group of Tasks having the same ITR would run inside a single TaskThread, correct?
- Tasks would be run every ITR, then Task becomes idle for the amount of ITR, then it starts again, correct?
- Tasks continue to run as long as Application is started up & running?


Best regards
Bilal Haidar
8 years ago
[email protected] wrote:
Thanks for your prompt response.

I went through the code and I noticed there is the concept of Scheduled Tasks. Mostly there are some auto-created once I installed the NC.

Question here, with this code:
new ScheduleTask
                {
                    Name = "Send emails",
                    Seconds = 60,
                    Type = "Nop.Services.Messages.QueuedMessagesSendTask, Nop.Services",
                    Enabled = true,
                    StopOnError = false,
                },


Does it mean that run this task every 60 seconds?


So, there is the concept of Tasks (ITask).

- ScheduleTaskService basically CRUD for Tasks into the DB.
- At startup, Tasks are run grouped by Seconds(Interval To Run - ITR). Meaning that every group of Tasks having the same ITR would run inside a single TaskThread, correct?
- Tasks would be run every ITR, then Task becomes idle for the amount of ITR, then it starts again, correct?
- Tasks continue to run as long as Application is started up & running?


Best regards
Bilal Haidar


RE: "Does it mean that run this task every 60 seconds?"
Yes.

RE: "So, there is the concept of Tasks (ITask)..."
Generally yes.

:)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.