I am developing a node.js app. In my app, I need to send blast emails and SMS to users satisfying a particular criteria. I use Gmail SMTP for emails and a third party vendor for SMS. I'm assuming firing the API's for email and sms services in a loop is dangerous. What's the right way do it?
Email and SMS queuing in NodeJS
2.8k views Asked by Jaseem Abbas At
2
There are 2 answers
2
Kishan
On
You can use kue npm library for creating queue of your email or sms tasks it runs parallels. https://medium.com/@techsuneel99/how-to-send-50000-emails-at-once-in-queue-node-js-b633ef9b3b30
Related Questions in NODE.JS
- Using Puppeteer to scrape a public API only when the data changes
- How to request administrator rights?
- How do I link two models in mongoose?
- Variable inside a Variable, not updating
- Unable to Post Form Data to MongoDB because of picturepath
- Connection terminated unexpectedly while performing multi row insert using pg-promise
- Processing multiple forms in nodejs and postgresql
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- How to change the Font Weight of a SelectValue component in React when a SelectItem is selected?
- My unban and ban commands arent showing when i put the slash
- how to make read only file/directory in Mac writable
- How can I outsource worker processes within a for loop?
- Get remote MKV file metadata using nodejs
- Adding google-profanity-words to web page
- Products aren't displayed after fetching data from mysql db (node.js & express)
Related Questions in EMAIL
- Email Verification python eror
- Invalid format for email address in WordPress on Azure app service
- How to create an JSOUP element from byte array image (Load from Database)
- How can I look this email address
- Gsheet - Automatically send an email using a date & time in a Cell
- Install Postfix Mail Server
- Error 553 5.7.2 [TSS09] When Sending Emails to Yahoo and Outlook
- How to make my form send the submitted info to my email
- Cpanel filter encoding utf-8?
- Thunderbird Importing Emails imports 0 emails
- Python & Django web app - auto emails not sending
- Allowing any member of a dynamic group to send as from a shared mailbox
- How to fix "search in state AUTH" errror
- Rewriting CSS in MSO conditional comment doesn't work
- Sendgrid attachments in C#
Related Questions in SMTP
- smtplib send email with set email image
- Error: Mail command failed: 530 5.7.57 Client not authenticated to send mail
- Sending email in django using smtp
- ASP.NET Core 6 Web API : best way to pause before resending email
- sending mail rejected due to TLS verification
- What does this mean "Error connecting to SMTP server: (421, b'Service not available')"
- Z3 to solve a puzzle(8 blocks tiles) please?
- Is it possible to encrypt WordPress E-Mails with S/MIME?
- Laravel gmail smtp not sending email on live server
- How to use git-credential-gopass with git send-email?
- Try Send Smtp in godaddy
- Can't connect to SMTP server using TLS
- AuthenticationFailedException while sending mail using google service account
- Troubleshooting SMTP Error 504 When Sending Email with Attachment
- unable to send email notification from jenkins
Related Questions in SMS-GATEWAY
- SMPP Bind Failed Error: Unable to Establish Connection with SMSC and Getting 'Bind Failed' Error While Trying to Connect to SMPP Server
- How do i send message via PHP using SIM800c USB Modem
- Trouble Receiving SMS OTP Code from Firebase in Flutter App on Specific Network Provider
- How to customize the SMS message template in Firebase Phone Authentication?
- SEND_SMS permission for a SMS Gateway application
- Kannel SqlBox not working... Showing error: Trying to fetch variable `ssl-client-cipher-list' in group `sqlbox', not allowed
- Can't connect to my rbsoft SMS gateway database after moving website hosting - how to fix?
- How I can send the link through SMS gateway using Laravel
- Vonage\Client\Credentials\Basic not found
- Outbound format for SMS to Jamaica from US
- SMS Gateway in Blazor Webassembly
- how to compare predefined text with mentioned variable words position against another text using regex and output as boolean or in percentage match
- How to integrate msg91 api with node
- How to create an SMPP server
- What is the best way to test Multi-Factor Authentication using Cypress?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The time spent is obviously proportional to N, being N the size of your set. As much users you have, longer it takes. Keep in mind that requests over the network are not blocking in any case.
Anyway, unless it risks N to be thousands or millions of items, you can do it in a loop and attach a proper callback to handle responses/errors.
Otherwise, you can send an email/sms and schedule the same operation for the next element using
nextTick(see nodejs documentation for further details). This way you'll spread all the activities over several iterations of the event loop.