Custom Premailer Modifications

I’ve had to do quite a bit of email newsletter design recently and I’ve become very familiar with premailer, an awesome open source email preprocessing library that makes developing emails a little more sane.

My workflow is a bit different than what premailer expects out of the box, and there are a couple of improvements that I wanted to add to the project. I’ve forked the project, merged in some other users’ improvements, and made a couple customizations:

  • In plain text mode, links and the parentheses surrounded the links, will not be broken up onto separate lines
  • Images will be replaced by their alt text
  • Instead of using the remote CSS file <link />ed in the HTML when using –base-path premailer will search for the local CSS file based on the path of the input file and use that if available. This is helpful when you have a local CSS file that you want to use to ‘compile’ the email newsletter HTML but have a different CSS file on the server that you want to use to display the email on your website.
  • Unmergable styles will be written into the body (makes a little easier for copying output into iContact and other ESPs)
  • The MailChimp reset styles will be preserved

Just an FYI for anyone looking for similar modifications to the default premailer.

Lion Frustration Fixes

Installed Lion today, some great improvements, some not so great (iCal… really?), and some frusterating changes than can be fixed.

  • Scrolling seemed delayed and generally choppy on my magic mouse. The scrolling preferences are completed removed from the mouse system preferences. Instead they are hidden in the “Mouse Options” button in the “Mouse” tab of the Universal Access system preference. In the mouse tab you can also remove the scrolling delay.
  • Safari’s cmd+option+l to open the download window was removed! Luckily you can add it back using a script by Daniel Jalkut bundled in a service bound to to the cmd+option+l keyboard shortcut.
  • The new window zoom animation is really annoying. Luckily, you can disable it
  • The only widget I really use is BeRuler, a simple measuring tool. It is only useful if the dashboard lays on top of the screen. Thankfully you can bring the translucent Dashboard mode back
  • Mail has annoying new animations too, the hidden preferences to disabled them are:
    defaults write com.apple.Mail DisableReplyAnimations -bool YES
    defaults write com.apple.Mail DisableSendAnimations -bool YES
  • Not Lion specific, but I’ve found this to be very useful:
    defaults write com.apple.finder _FXShowPosixPathInTitle –bool YES
  • As a web developer I have a lot of windows open, I don’t want them restored after when launching Safari.
    defaults write com.apple.Safari NSQuitAlwaysKeepsWindows -int 0

Dynamic AJAX Content, Internet Explorer, MooTools, and Form Elements

Another day, another Internet Explorer bug. I was using MooTool’s Request.HTML to load some AJAX content to display within an inline popup and IE kept throwing the classic “Object doesn’t support this property or method” error. The error was occurring inside document.id (i.e. the dollar function) which made the issue even stranger. Looking at the dollar function’s source code, it seems as though methods are copied from Element.prototype to the element being retrieved.

The AJAX content I was loading contained a form which had a form element with ID “position”. When the Request.HTML receives html content it retrieves a list of all elements contained with the AJAX response using getElements(“*”). This caused the document.id method to be called with the form element of ID “position” contained within the HTML response as its argument, which caused the following assignment to be made:

theFormElement["position"] = Element.prototype["position"];

Which then triggered the above mentioned IE error. Since theFormElement["position"] is a read-only reference to the input element contained within the form IE threw an error. Be aware of the ID / name you assign to input elements when debugging obscure bugs in internet explorer!

Using VMWare + Windows to Test Web Sites on Windows

Step 1: Retrieve Emulator’s Gateway IP Address

Grab the inet number resulting from `ifconfig vmnet1`.

Step 2: Add Test Site’s Local Hostname to Window’s Host File

For each site I develop I setup a new Apache virtual host (some info on apache virtual hosts here). For instance, the local domain / hostname for a website could be mabblog.localhost. When developing locally there are some hardlinks to the local development hostname, for this reason the it isn’t enough to use the inet vmnet1 address retrieved above when debugging in VMWare / Parallels; the local hostname must be added to the Windows host file.

Wikipedia has an extensive listing of the location of the host file on various systems, on Windows XP it is located here:

c:\windows\system32\drivers\etc\hosts

Open up the file in notepad and add your host entry, for example:

172.16.232.1    abc.localhost

Step 3: Add Emulator’s Gateway IP Address to Your VirtualHost

In order for apache to properly handle the request coming from the emulator gateway you have to add the emulator gateway IP to the VirtualHost statement.

From: /etc/apache2/users/Name.conf

NameVirtualHost 172.16.232.1
<virtualhost 127.0.0.1 172.16.232.1>
ServerName abc.localhost
DocumentRoot /Users/Mike/Sites/abc
</virtualhost>

References:

Part 2: Thoughts on Buzzmarketing

Empowered Interactivity

A while ago I read an article on the lessons to learn from the DropBox marketing model. After reading the chapter on empowered interactivity I immediately recalled that article and how incentivizing referals increased signups by something like 60%. People generally want to share what is useful to them, and they really want to share something if it can benefit them in someway. When thinking of what the word ‘benefit’ (or more specifically, economic incentive) means to a given person I immediately think of the RSA Animate video about what motivates us and the example they give about Wikipedia: experienced professions and academics who could easily use hours spend researching and writing Wikipedia articles working for sizable monetary reward instead choose to work for free. Why? Because it is satisfying: there is a social currency that one receives when achieving something that a community of persons respects and affirms. This is why the FAQ model that Stackoverflow employs works so well (although the model has changed a bit since they tied site reputation to the ability to interact with the Careers site).  This is why monetary referrals without social recognition don’t always work so well.

Secrecy

These couple lines rung true with a couple recent products / marketing efforts I’ve seen:

Secrets are currency. Revealing a secret is a definite conversation starter… Limit those in the know of a secret, those not in the know want the currency of knowing – they want to be part of the exclusive circle. (Buzzmarketing, P.37)

Push Pop Press immediately came to mind while reading this. They haven’t released anything yet, they have only demoed the product to a select few, and there are no publicly available demo videos. They are near 6,000 followers on twitter and really haven’t put any money into marketing their product. I’m interested in what they are coming out with, and I’m sure many others are too. They are definitely playing the secrecy card correctly. The MacHeist bundle was successful because of exclusivity and secrecy that they built up around the bundle. Apple (obviously) does this with almost all their product releases. Gmail did this with the invite system when gmail originally launched. Being in the know is attractive, and people will ’spread the word’ if they know something others don’t.

Thoughts on Buzzmarketing

I’m currently reading Buzzmarketing by Mark Hughes, a book about word-of-mouth advertising. I’m only about a 1/4 way through the book but as I’m reading through the book I keep comparing the ideas that he is presenting to experiences in my own life in order to understand the practical application of his ideas. I’m not a marketer by trade, this book is the first step in my goal to achieve a better understanding of marketing methods (especially marketing via social networking channels).

The two key concepts I’ve pulled from the first section of the book are: 1) the human desire of having something worthy of the interest of others 2) the effectiveness of creating a ‘pre-packaged conversation’ that people want to share with others. As I was reflecting on these two key concepts I’ve thought of a couple examples which show how these concepts play out in the ‘real world’.

The ‘Bed Intruder’ Song

The bed intruder song, virtually overnight, became the funniest most watched “have you see this?” video on YouTube pushing the song to the top 100 chart in iTunes. This video definitely pressed the ‘hilarious button’ that Mark talks about in his book.

Failed Door-to-Door Marketing

Open Range is a new internet service being rolled out in the town I’m currently living in. I don’t know much about the service other than it is lest costly than the standard cable + internet combo offered by Comcast. There is a door-to-door marketing effort going on in our neighborhood. I don’t like door-to-door marketers, I don’t want to talk to them and avoid conversation if at all possible. Mark recounts a story about a car company that used a ‘moose button’ to start the conversation between store employees and customers about a new brake product / sale. Each employee had a big button with the image of a moose pinned to their shirt. Something wierd or different that inspires the customer not the sales person to start the conversation. If this open range salesman had something interesting or weird to attract me to him I probably would of asked him what was going on, instead he approached me with the classic boring line “Have you heard of open range?”.

Having something worth sharing makes you feel as though you have some sort of unique worth, giving others this worth or ‘buzz currency’ in a way that is connected to what you are marketing seems to be the key to effective social / word-of-mouth marketing. The interesting thing about this marketing model is it preys on the insecurity of the human race, it assumes that people want to be noticed and approved of by others.