Hosted Email for Rails App - ruby-on-rails

I'm looking for an alternative to Google Apps for sending email from my rails app. (Google limits the number of messages you can send).
Do most people roll their own, or is their a preferred provider?
I'd love to be able to dynamically create addresses for my customers: customer_name#myapp.com

We use AuthSMTP which does a quality job of informing you when you've been reported as SPAM and keeping you off of block lists.
It costs, but is very reasonable.

Just to give an update, it looks like the new hotness is SendGrid. Take a look if you're in the market for hosted email for your rails app.

If you're hosting on a Linux server and just looking for something to send emails from your rails application, rolling your own SMTP server really isn't rocket science. You'll find tons of manuals out there on how to deploy a SMTP server on your Linux distribution of choice.
Postfix would be the de-facto-standard and Qmail is my personal weapon of choice when it comes to security, reliability and speed.
If you want to provide your customers with mailboxes (POP and/or IMAP) for incoming emails, it wouldn't be rocket science either to deploy your own server, but the administration of this servers and the support calls from your customers could become a pain. :-) In this case I would go for Google Apps. The $50/year/customer for the business option probably would be the choice for your corporate customers.

I've had good success with Postfix with Rails and Linux in production. Once the site got beyond small, connecting to Google Apps for each email became impractical (it would fail or timeout somehow once every couple hundred emails). For doing a mass mail to all your users, very impractical.
There is a good series of articles for getting postfix set up on SliceHost's pages
http://articles.slicehost.com/2008/9/2/mail-server-overview

Related

How to send recurring, custom emails to my users?

I have a site with many "channels" customers can subscribe to. I want to send each customer a unique weekly email based on any new content from their subscriptions, plus some suggestions of additional subscriptions. Feels like a very common use-case.
I'm not sure the best approach or service to use here. I could code everything myself and run a recurring job to send the emails. It feels like there should be a service which has a list of my user ids and pings my server for all the custom fields to inject into an email. But I can't find such a service.
Can anyone recommend a best practice for doing this kind of thing? (I'm using RoR on Heroku and have an Mandrill account.)
From looking over your question, it seems that you're looking for the "missing piece of the puzzle" to help you get this setup. So I'll give you some insights that we've found:
Queuing With Redis & Resque
Resque & Redis are technologies for handling queuing with web-based applications
Resque is a gem which allows you to host "queues", and process them in the background (with cron jobs & the like). On the Heroku platform, you'll be able to use the Heroku Scheduler to process the queue as-and-when required
Redis is a technology which runs parallel to your application, allowing for the storing of JSON-type data objects (key/value pairs). Heroku has several third-party redis addons you can use, which will get you started & allow you to scale. Redis is best described as "RAM" for your app - allowing you to store a series of data objects that can be used independently to your app's RESTful infrastructure
Resque Railscast
Ryan Bates actually explains the Resque process very well on one of his RailsCasts. I'd check it out & implement the code to get it something down; you can then iterate on top of it later!
I can post live code if you want?

What technology should I look for to queue up emails to send to users?

I'm hosting a small pet-project Ruby on Rails application and I have a small feature:
I want to send an email to every person who bid in an auction every time they are outbid.
If 10 people bid on an item, you can imagine how this will scale if I were to just send the emails willy-nilly from my RoR application.
What do I need to use for this scenario if I want to queue up emails that need to be sent? Since this is hosted on a DigitalOcean VPN ease of installation and configuration is a must for me, as well as a great RoR integration.
Any suggestions on what I need to look for?
For the Emails services you might consider, I think this is pretty good price comparison: CLOUD EMAIL SERVICE PRICE COMPARISON, so the services which are pretty mature and easy to integration(you can find the gem in github) is following four: Sendgrid, Postmark, Amazon SES, Mailgun.
Amazon SES provide a very basic email sending solution, but other services like Mailgun provide extra services like mail list or campaign etc.
Cause the sending mail might be a time consuming task, so you can use delayed job(queue service gem) to delay the mail sending, now the most popular one should be Sidekiq, other available options are Resque, delayed_job. Sidekiq and Resque need Redis installed(it need to serialize the jobs into Redis), the delayed_job can just serialize the jobs into the database.(If you just need a very simple delayed job processing, you can choose delayed_job).
So the simplest combination for now can be Amazon SES(https://aws.amazon.com/ses/) + delayed_job(https://github.com/tobi/delayed_job).
Good luck!

Pitfalls of sending eNewsletters with ASP.NET MVC

A client needs to send out eNewsletters.
We tried using their Sitefinity CMS, but it hangs for reasons that are hard to determine.
As a result, I am inclined to "roll my own".
However, various pitfalls yawn deep and dark along the imagined path.
For example:
Imagined Pitfalls
My client's domain gets blacklisted.
The emails get rejected as Spam.
Presumed ways of avoiding imagined pitfalls:
a. Send out emails with a delay of, say, 2 seconds between each one.
b. Send out emails individually, ie, no CC or BB.
Questions:
Are my imagined pitfalls and presumed
ways of avoiding them correct?
Can you think of other pitfalls?
Or better ways of avoiding them?
Do you know of reliable software that
just does this (ASP.NET, MVC by
preference, drawing form SQL Server
db).
It may be beneficial to use a third party like Constant Contact to handle sending your email campaigns. They expose an API that you can tap into via REST and it won't have any effect on your client's domain. Constant Contact is a reputable company and email campaigns they send out rarely get caught in Spam filters. My company currently uses the service, but not the API and its been very successful.
Constant Contact's Website
CC's API Web Site
Example of creating a Campaign
You should never do this. Your client's IP(s) and domain(s) will find themselves blacklisted to the point that even their legitimate, hand-crafted emails won't make it past spam filters at large mail services.
Use something like SendGrid if you want to stay closer to the metal than a service like MailChimp or Constant Contact.
There are other companies out there which do it, such as BriefYourMarket ... never roll your own :-)

what in/out bound mail system to use ? hosted or not?

I have a ruby / rails application that integrates in and outgoing email directly into the app. The app is going to be running on multiple domains each with posible many users sending and recieving email.
I have looked into sendgrid, mailchimp and mad mimi as hosted services and also looked to create my own email server.
There are advantages and disadvantages of both solutions and i am not sure which one to go down and am hoping someone can give me advice ??
Any help will be great. I know email is a hassle to manage but once set up correctly cant be that bad ??
Thanks in advance
Rick
Hosting your own Mail Transfer Agent (MTA) has some benefits with easier mailbox creation and less latency but it requires significantly more maintenance. There's also the problem with spam filtering that would require some constant tweaking. An outside firm will likely have a more advanced filtering system in place that you can leverage the larger quantity of traffic passing through it.
Never underestimate the increased effort for uptime as more components are integrated.
I'd use Heroku, the have some mail add-ons

Mass emailing users of a rails app

I have a rails app that just launched and I have over a thousand users signed up to the site. We are interested in keeping in contact with the community through email newsletters. We have been using a third party tool and migrating the email addresses from one database to another. Is there an easier way to do this from rails? I am open to suggestions.
http://github.com/adzap/ar_mailer
ar_mailer will allow you to queue up mail and send it out over time so you don't violate any mail rules put in place by your host.
If you really, absolutely, definitely need to send to these emails yourself, and you're dealing with a larger user base, you'd probably want to go through a distributed setup employing something like Starling, RabbitMQ, or the all-new Resque to distribute the task of sending these emails across a multitude of workers.
It's a topic far from trivial, so all in all I'd recommend using an external service provider for this.
Use ActionMailer to generate emails from templates (views) using Erb. I would do this unless you wish track clickthroughs back to your site from those mails, then you may be better of using a third party.
As an aside (I'm sure you know this but), be aware that you'll need to inform your ISP and demonstrate to them that you have permission from your users to send these emails, else they may block you from sending without warning.
You can simply loop through all the emails and send individual emails. It's pretty simple using rails and there are tutorials everywhere.
You could also use the third party API to add automatically your users emails to their database. If you could provide the third party you're using, I could maybe give you more information.
Some newsletter website give you the option to add emails directly in their system via a given form. Why not use this form? You would put it somewhere on the website and the system will add the new emails to the third party software and not to yours. Of course this only works if you have a "enter your email here to subscribe" kind of logic.

Resources