App Store

TextMate Email Bundle

Developed by

If you're a TextMate user you might find this bundle especially useful when testing templates.


Description

This TextMate bundles allows you to easily bring your CSS styles inline as well as send email right from within TextMate—especially useful when you’re in the middle of testing multiple changes.

Setting up the bundle

Before we get started I’d like to mention that this article is not really for the faint of heart. It’s for TextMate users only, and requires you to install a few 3rd party Ruby gems and be comfortable with opening a Terminal window. If any of this sounds like greek, fret not, this article just isn’t for you ;)

Here’s the basic outline to getting started.

  1. Enable “Access for assistive devices”. You can do this by going into “System Preferences -> Universal Access” and checking “Access for assistive devices”.
  2. Install the OS X developer tools (Xcode). The setup can be found in either the “Optional Installs” folder on your OS X retail disc, disc 2 of your OS X system discs, OR download it directly from Apple here. This is required since by default, OS X doesn’t install the Ruby header files.
  3. Open up a Terminal window and install the following Ruby gems. Please note, make sure to install all dependencies and for hpricot, choose option 4 (0.6 Ruby).

    sudo gem install mailfactory
    sudo gem install hpricot
    sudo gem install tamtam
    sudo gem install tlsmail

  4. Download, unzip and double-click the following bundle.

Configuring the bundle

Before you can use the bundle there is a small amount of configuration you need to do. Primarily, setting up the SMTP server to send email from. Since this will is unique to every person we tried to make this as easy as possible for the majority of users.

You can access the configuration by opening TextMate and going to “Bundles -> Bundle Editor -> Show Bundle Editor” and then choosing the “Email Tester” bundle. The email settings will be similar to those you setup in say, Mail.app or Thunderbird. Change these settings to match your SMTP server. In this screenshot I am using Gmail as an example.

Not all servers use SSL, so make sure to set these options to exactly those of your SMTP server. You shouldn’t need to edit the “to=” variable.

Using the bundle

Using the bundle is pretty straight forward, what we did was add 3 commands that can be accessed under “Email Tester”. Here’s what each does, in all 3 commands we extract the contents of the <title> for the subject.

  • Email page to… (bring CSS inline)
    This command looks for either a .css file or inline styles and brings them inline. In the event that you have both defined in your HTML, the command will bring the CSS from the file inline and ignore the style defined in the <head>. Upon activating this command you will be prompted to enter a destination email address.
  • Email page to… (as is)
    This command doesn’t touch any of your CSS. It does not bring the CSS inline and simply allows you to send the HTML email to a designated email address.
  • Generate new doc w/ inline CSS
    This command will open a new document in TextMate with all of your styles (based on the rules in the first command) inline. Mainly used for checking and in the rare event when you don’t need to email a test copy.

That’s about it! You can assign keyboard shortcuts to each command if you want to make it even easier, but that’s the basics.

Installation / Documentation

Author: Campaign Monitor
Version: 1.0.0
Date: January 18, 2012
License: Freeware
File Size: 8.7k

Recommended apps

Podio Developed by PieSync Enjoy continuous two-way syncing between Podio and Campaign Monitor with PieSync's connector.
Piesync Developed by Piesync Enjoy continuous two-way syncing between your favorite cloud apps and Campaign Monitor with PieSync's connectors.
Burst SMS Developed by BurstSMS Map customers to both email and phone number information with this text messaging solution

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free