The quick, easy, free way to send mail-merged email from a Mac

Suppose you’d like to use your Mac to send a couple hundred* customized emails once in a while, importing the recipient’s email + name + other data from a CSV file.

You’d think it would be a piece of cake.

Turns out, Apple Mail is worthless in this respect. Open Office has a built-in mail merge feature but it is poorly documented and horribly designed and works even worse. There is a Mac app called MailMergeApp, but it’s useless if you need to merge data from anything other than your Address Book.

Here’s how to do it using free software, and get it working in a few minutes:

1) Install the Thunderbird email client, at least for the purposes of sending merged-emails. (You don’t have to throw away your favorite email client.) We installed Thunderbird and configured it to use a dedicated outbound email address*.

2) In Thunderbird, open Tools > Addons and find and install the “Mail Merge” addon.

3) Follow the detailed step-by-step instructions on the Mail Merge webpage.

We particularly like the “send later” feature which creates each email and puts it in your Outbox, so you can make sure it all looks good before you do File > Send unsent messages

** Note, if you’re sending from a non-bulk-sender account (such as a typical Gmail or Godaddy email address), just keep in mind you probably have a maximum of 250-500 emails you can send per day. *

A subtle problem with using update_attributes in Rails migrations

It’s fairly common to create a Rails migration that adds a column, then stuffs data into that column for legacy data, for example the addition of a guid field.

However, using update_attributes can quietly bungle your database by skipping certain records if you have added any new validations which did not apply to legacy data in the database.

For example, suppose you’ve had a Widgets table for a long time, and it has lots of existing Widgets in it. Originally, the name of a Widget could be any length, but a few months ago you added a validation so a Widget name should be at least 10 characters going forward.

Now you want to add an 8 character guid to Widgets. If you run the following migration using update_attributes (instead of a save(:validate => false) as I show here) your migration will pass, so you’ll think everything is fine, BUT any widgets with a too-short name will not receive their guid because the valiation fails.

Obviously there ARE times when you want validations when adding data, but probably not in a case like this where you are adding a new field with a use that is independent of any prior data values.

class AddGuidToWidgets < ActiveRecord::Migration
  def self.up
    add_column :widgets, :public_guid, :string

      # MUST reset to ensure new column info used
    Widget.reset_column_information
    Widget.find(:all).each do |w|
      g = (0...8).map { 65.+(rand(25)).chr}.join
      while !FinderItem.find_by_public_guid(g).nil?
        g = (0...8).map { 65.+(rand(25)).chr}.join
      end
        # can NOT use update_attributes because might have validation errors
        # due to new validations added on certain other fields
      w.public_guid = g 
      w.save( :validate => false )
      #DONT USE: w.update_attributes :public_guid => g 
  end
  ...

Tips for biking the Hiawatha trail

The munchkin and I did the Hiawatha trail yesterday and it was simply fantastic. Some tips:

If you can go on a weekday, it’s 1/3 as many people.

Bring a GOOD headlamp (or bike lamp), extra batteries, and if you wanna be a good scout an extra headlamp just in case.

They have several places along the trail with coolers of water, so a single water bottle will probably do you fine.

Drive to exit 5 in Montana, follow the Hiawatha signs to the East Portal trailhead. Get your $9 trail ticket.

Bike downhill, plan on 2.5 hours (we did it in 2 but we liked to go a bit faster) to get to the bottom (“Pearson” portal). Take the $9/person shuttle back up to the west end of the tunnel (“Roland” portal) then it;s about a 10 minute bike right through the tunnel back to the east portal where you parked.

Remember the time zone difference! The start of the trail is in Montana (MDT) and the end of the trail where the buses are is Idaho (PDT). The bus schedules are PDT.

Multiple subdomains, multiple apps in Heroku

For a variety of reasons we sometimes want to have multiple subdomains point to one heroku app, and then have another ‘main’ app or webpage pointed to by www. It’s easy to configure. The other explanations I read are a little general, here are the specifics…

The explanation at heroku is very good, at : http://docs.heroku.com/custom-domains (there’s even a very good screencast shows step by step)

the key thing is if your ROOT domain (mycoolsite.com) is at Heroku you want to create THREE “A” records, because they do some fault-tolerant crossover magic. So you’d have an A record for

75.101.163.44
75.101.145.87
174.129.212.2

Now for each subdomain you create a C record

www -> proxy.heroku.com
client1 -> proxy.heroku.com
client2 -> proxy.heroku.com
client3 -> proxy.heroku.com

NOW on the Heroku side, you have two apps right? The ‘main app’ and the saas app.

Login, and for each app go to Resources -> Addon -> Get More Addons ->Custom Domains (free)

for the main app, add ONE domain: www.mycoolsite.com

for the saas app, add each of the clients, eg:

client1.mycoolsite.com
client2.mycoolsite.com
client3.mycoolsite.com

Lemons to lemonade when the airline strands you

I always though this was kind of obvious, but a number of friends thought this was clever so I’ll pass it along…

Last week I was supposed to return from NYC (Newark, the *only *airport to use when flying to/from NYC) via Denver back to Spokane. Weather delays the morning of the flight meant not only would we miss our connection in Denver, we could not get a flight the next day either. So we’d be stranded in Denver, on our nickel (no vouchers, since weather delay).

When that happens, I look at the upcoming flights, pick a place I’d much prefer to be stranded instead (San Francisco in this case), and without exception I get the flight I want if (a) there are seats and (b) if it’s closer to my destination than where I’m starting from (e.g., the right general direction) and (c) I point out they won’t be giving me vouchers so the least they can do is send me where I have friends to stay with.

So the next day, my daughter and I had a nice day in San Francisco, saw some friends, ate some dim sum and tapas… essentially a free round-trip for two to SF compliments of United.

Squeeze that lemon.