Super simple MeteorJS App built for a friend, for sending blast of emails to a list of recipients through the MailGun API.
The entire WebApp, from inception to completion, has been implemented in 4 days of part-time work.
- MeteorJS
- MongoDB
- MailGun API
Currently
- Authentication-based app
- Realtime reactive interface
- Async cron jobs for email queue processing, suitable for being externalised into a micro-service.
- Handling huge email lists, with email throttling (max 10 emails/secs to avoid flooding the mail server)
- Notification of email deliveries/bounces/rejections
Planned
- User Registration page and email validation flow
- Search/filtering in the job list page
- Interruptible jobs
- Tracking of opened/unread emails
Login
Job list (a.k.a. History page)
Queued job
In-progress job
Job completed (all mails delivered)
Job completed (but not all emails have been delivered by MailGun)
Job Error (no mails have been sent)
Job Details page
New Mail Blast (Compose page)
New Mail Blast submitted in the queue
- Install MeteorJS v1.2.1
- you need a MailGun account (a Free tier will do) and your API key
- before running your server export the MAIL_URL environment variable:
MAIL_URL=smtp://<your domain SMTP login in mailgun>:<your SMTP domain password>@smtp.mailgun.org:587
- run the GunBlaster server from the app/ folder
cd app
meteor run --settings ../config/development/settings.json
- you will need to manually create your user (no registration page yet).
- launch the Meteor console (
cd app; meteor shell) - manually insert a record for your user:
Accounts.createUser({username:'...', password:'...', email: '...'}) - verify your email (only verified emails can send email blasts)
Meteor.users.update({username:'<your username>'}, {$set:{'emails.0.verified':true}})
- launch the Meteor console (
- access the app from
http://localhost:3000
MailGun has to be correctly configured to send callbacks to your Gunblaster server in order for the delivery/bounce notifications to be received. To do so, go to the MailGun "WebHook" page and setup your server address API endpoints:
If your server is not publicly visible on the Internet, you can still test the hooks using a Tunneling service like https://ngrok.com/
Setting up ngrok is ridiculously easy. Just download it and then run it, pointing it to your local server:
ngrok http 3000
This will give you back a public ngrok address (like http://xxxxxx.ngrok.io) that you can use in the MailGun hooks page. Any request to that address will be routed automatically through the tunnel to your localhost:3000 port.











