Answer the question
In order to leave comments, you need to log in
How to create a mail queue using kue?
Good afternoon.
There are letters that the user sends.
When sending, each letter is placed in the database, where it is assigned the number of the letter and the time it was added to the database.
In sending letters, there is a limit per minute, that is, the user cannot send more than 100 letters per minute. If the number of letters is exceeded, then the next letter will be queued and sent in a minute, and so on.
Here is part of my code.
queue.create(`email`, {
title: `HELLO KUE 1`,
id: Math.floor(Math.random() * Math.floor(100)),
to: '[email protected]',
})
.save((err) => {
if (!err) console.log(`error`);
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question