<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog &#124; The Working Group &#187; ar_mailer</title>
	<atom:link href="http://blog.twg.ca/tag/ar_mailer/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.twg.ca</link>
	<description></description>
	<lastBuildDate>Fri, 23 Jul 2010 01:09:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Rails mass mailing &#8211; it shouldn&#8217;t be this complicated</title>
		<link>http://blog.twg.ca/2009/09/rails-mass-mailing-it-shouldnt-be-this-complicated/</link>
		<comments>http://blog.twg.ca/2009/09/rails-mass-mailing-it-shouldnt-be-this-complicated/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:16:32 +0000</pubDate>
		<dc:creator>Jack</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[ar_mailer]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[posategapp]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://blog.theworkinggroup.ca/?p=57</guid>
		<description><![CDATA[The requests we get from our clients for &#8220;social networking&#8221; type tools and features has grown exponentially over the past two years. To make a user experience relevant, easy, secure, means that an application will need to send email notifications to that user (to register, to tell them of friend&#8217;s messages, to send them newsletters [...]]]></description>
			<content:encoded><![CDATA[<p>The requests we get from our clients for &#8220;<em>social networking</em>&#8221; type tools and features has grown exponentially over the past two years. To make a user experience relevant, easy, secure, means that an application will need to send email notifications to that user (to register, to tell them of friend&#8217;s messages, to send them newsletters or updates, to send tickets, calendar bookings .. the list goes on).<br />
<strong><br />
Why is this a problem?</strong> Because sending an email is not an instantaneous action. The more emails you try to send, the longer you may have to wait as the application sends them. Imagine an app that lets you invite 300 friends to an event. Multiply this with 300 people sending the same invite to their friends.</p>
<p>While Rails was kind enough to provide a simple way to send emails, it left out one important detail. <em>You can only send one at a time!</em></p>
<p>If you find yourself in the unfortunate position where you need to mass mail then you&#8217;re on your own. So what do you do? You Google around of course. Someone is bound to have figured this one out.</p>
<p><strong>It looks like there are 3 ways to solve this:</strong></p>
<p><strong>1. Use existing email marketing services</strong></p>
<p>You can go with this option. There are plenty out there: Mail Chimp, Constant Contact, Thin Data, Campaign Monitor, Campaigner and others. All you need to do is generate some kind of mailing list and import it into one of these systems and then keep it up to date. But that&#8217;s not always practical. Not if you want your users to be able to initiate the mass mailing by themselves.  Don&#8217;t get me wrong, these services are great at what they do, but what we really want to do is to send mass emails from our own app.</p>
<p><strong>2. Use existing code</strong></p>
<p>If you really want your Rails app to be able to send mass mails at a click of a button you can try using Eric Hodel&#8217;s ar_mailer which is on version 1.4.0 as of June 2009. This has the advantage of letting you use the email addresses that you already have on your system (no exporting and importing to a different system) but before you get to that you still have to integrate it with whatever version of Rails you happen to be using.  Assuming you get it working properly, now you have a brand new background process to take care of.</p>
<p>Ar_mailer is great but leaves you half way there.</p>
<p>* The queue is not smart enough to prioritize emails. If one user sends 5000 invitations and after that another user wants to recover his password, he&#8217;ll have to wait until all 5000 emails are sent before he gets his password back. The users receiving the invitation won&#8217;t notice if  it takes a bit longer to reach them, but the guy that is trying to recover his password will be upset if he doesn&#8217;t get it right away. This is obviously not good enough.<br />
* How do you monitor if an email has been sent or failed?<br />
* If you have an email template and your client wants to change it all the time, what do you do?</p>
<p><strong>3. Build it all from scratch</strong></p>
<p>Even if you decide to do it yourself from scratch you&#8217;ll still need a queue to store the emails that will be sent at some time in the near future by another process running in the background. From there on, it depends on what you really need. Be prepared to put aside some extra time because it ain&#8217;t simple.</p>
<p><strong>So what would be the perfect solution? </strong>Simply put: I don&#8217;t want to have to worry about it. I want to be able to say: &#8220;Here&#8217;s my email, here&#8217;s the list of people I want it sent to. Go and do it &#8230; please&#8221;.</p>
<p>Wouldn&#8217;t that be great? Sure it would! We&#8217;ve encountered this problem enough times to make us want to solve it for good.</p>
<p><strong>And so we&#8217;ve set out to build it and this is what we think a mass mailing solution:</strong></p>
<ol>
<li>I want to be able to use it independently of the language I&#8217;m coding in &#8211; it needs to have an API</li>
<li>I want to be able to use the same code I have right now (layouts, email templates, etc.) &#8211; it needs to integrate easily</li>
<li>I want to know if a specific email was sent, failed or if it hasn&#8217;t been sent yet and I want to know why &#8211; it needs reporting</li>
<li>If a client complains that the emails aren&#8217;t rendering correctly I want to be able to see what they are receiving &#8211; it needs to let me look at the emails sent</li>
<li>I want to be able to easily resend any email &#8211; it needs to let me act on it</li>
<li>I want to create and manage email templates so that my client can edit them without asking me every time and without forcing me to change the code and to deploy my app all over again &#8211; it needs an optional template management system.</li>
<li>I want the queue system to be smart enough to distinguish between a single email and a batch of 5000 emails and prioritize them accordingly &#8211; it needs a smart queue system.</li>
<li>And most importantly, how can all of this be done with minimal effort to set it up each time I create a new app. &#8211; it needs a plugin.</li>
</ol>
<p><strong>Postage App!</strong></p>
<p style="text-align: center;"><img class="size-full wp-image-204 aligncenter" title="Mass mailing app" src="http://theworkinggroup.ca/system/files/19/original/postageapp-mailing-diagram.jpg" alt="Mass mailing app" width="525" height="300" /></p>
<p>We are currently developing this system which will help us build better apps. We&#8217;re building it according to our needs and we think that these might also be the needs of other developers out there. <a href="http://postageapp.com/" target="_blank">Check it out and sign up</a> for an update on the developer free release!</p>
<p style="text-align: center;"><img src="file:///Users/jneto/Library/Caches/TemporaryItems/moz-screenshot.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.twg.ca/2009/09/rails-mass-mailing-it-shouldnt-be-this-complicated/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
