What is a cheap (free) way to send email notifications to Heroku?

I am creating a web application that sends email notifications when a user's post receives a new comment or if a user is mentioned.

I am using Postmark along with ActionMailer to send email, so in my comment controller whenever a new comment is created, this action triggers Mailer to deliver the email. The thing is, it's not as fast as I expected and delays the response - when the user submits a comment, they don't immediately receive a response via ajax, but waits for the controller to finish sending the mail.

So, naturally, I decided to try the job_delay background processing. Well it does work and now I get an immediate response when I post a comment. However, I just realized that in order to run delayed_job on Heroku I need to manually start the working dyno and after that it stays on until I decrease it. And it seems to be worth the money.

I want to try this by spending as little money as possible and have searched to see if there are any solutions. I found a solution called HireFire that automatically starts your dyno when it is running and disables it when not running (https://github.com/meskyanichi/hirefire), but this solution charges a service fee which is cheaper though than nothing but still surpasses my original goal.

I’m even thinking about just without delay and sacrificing response speed, at least until I see any linkage to the site.

So I'm wondering if there is any solution (or hack) that allows me to send emails to Heroku for free? Or are most of the people who create sites that do something like this just paying for an extra working dino?

Or, would it be okay to just bypass the background processing of the ActionMailer at least at the beginning? (I'm not sure how much download this is on the whole server, for example if ten people comment on something at the same time, if it affects performance for the rest of the site users)


source to share

3 answers

Hirefire should be the best for you. I think you can use it for free, it is open source, but dunno the requirements to run it.

Another solution would be to add iron to the worker. They give you 25 hours of free working time per month.



IronWorker should suit your needs well. (Note that I work for Iron.io.) No need to manage servers. Just create workers, upload them to IronWorker, then start immediately or pay for them later - IronWorker has flexible scheduling options. As mentioned in another post, a good amount of hours comes in a month.



If you don't need real time, that is, you are happy with the 10 minute delay, you can simply use the Heroku scheduler. Run a task every 10 minutes, which starts your current job queue and then dies until the next 10 minute iteration.

Not free, but not like waiting in line for a worker.



All Articles