May 9, 2011, 5:30 a.m.
posted by neverloop
Create Yahoo! Mail Macros
With a combination of email drafts, direct URL bookmarks, and bookmarklets, you can send complex emails with one click.
In the world of office software, a macro is a little bit of code that combines several steps of a process into a single click. Macros take advantage of a computer's ability to automate tasks and can significantly reduce any repetitive task that needs to be done. Taking this thinking to the world of Yahoo! Mail, you can create your own Yahoo! Mail macros to help you send messages.
The normal process of sending a message involves going to Yahoo! Mail, clicking the Compose button, selecting a recipient, typing a subject and message, and clicking the Send button. These steps aren't very labor-intensive, but if you find yourself sending the same types of email again and again, there are a few ways you can speed things up.
Imagine you send a weekly email with some statistics to a group of coworkers. The introduction, explanation, and ending of the email stay the same from week to week, with only a bit of text in the middle changing each time. The simplest way to automate this type of message is with the built-in Drafts folder at Yahoo! Mail. Draft emails are like templates that can be used and reused as many times as you need.
To create a draft, browse to the standard email form at Yahoo! Mail (http://mail.yahoo.com) by clicking Compose Mail on the navigation menu or pressing Shift-Ctrl-P on the keyboard. Give the email a descriptive subject line, such as "weekly stats message" so you'll remember what the message is for without reading the text of the message. Create the email as if you were sending it out, but when you're finished, click the "Save as a Draft" button instead of clicking Send.
Now, whenever you want to use the email you just composed as a template, click on the Drafts folder from your list of folders and find this message in your list. Click on the message subject to bring the email up for editing. Make any changes you need to the email, add any recipients, and click Send. The message will still be available in your Drafts folder, and you can use the message just like this at any time. If you ever want to remove a draft email from your Drafts folder, manually delete it by checking the box next to the subject and clicking the Delete button.
Yahoo! Mail Bookmarks
Another way to automate common tasks is by creating your own Yahoo! Mail URLs. With some information about how Yahoo! Mail URLs are constructed, you can create a direct link to the Yahoo! Mail form with the fields prefilled for you. For example, if you find yourself sending out the same email over and over again, you could create a direct link to your Yahoo! Mail that includes the full message and subject, saving you some copying and pasting.
To get started, click the Mail tab and then click the Compose button. Note the base URLeverything up to the yahoo.com. It should look something like this:
This base URL will vary based on the localized version of Yahoo! you're using and the way Yahoo! is balancing its servers. With the base URL in hand, add the following to specify the mail form and include your Yahoo! ID:
/ym/Compose?insert Yahoo! IDnull
So, putting these pieces together will give you blank new mail form, like so:
Insert base URL/ym/Compose?insert Yahoo! IDnull
To see the form change, add a variable/value pair to the end, using an ampersand (&), variable, equals sign (=), and value. For example, &[email protected] automatically adds the address [email protected] to the form:
Insert base URL/ym/Compose?insert Yahoo! ID null &[email protected]
Here are the variables you can use in the URL:
The email address of the recipient
An email address of a copied recipient
An email address of a blind-copied recipient
The subject of the email
The text of the message
Using a few of these variables together can give you a fairly complex message that's ready to go without any further action required beyond clicking the Send button. Here's an example:
http://us.f315.mail.yahoo.com/ym/Compose?insert Yahoo! IDnull&to=[email protected]&subject=hello&body=Hi%20Bob%2C%20this%20is%20my%20weekly%20email%20that%20always%20has%20the%20same%20text%2E%20I%20created%20a%20Yahoo%21%20Mail%20URL%20so%20I%20wouldn%27t%20have%20to%20re%2Dtype%20this%20each%20time%2E
Note that the message text is URL-encoded, which means some characters, such as spaces, are converted to their URL code equivalent (%20 is the URL code equivalent for a space). Look carefully between those %20 s and you'll see the text of the message. This encoding is required because some characters (such as spaces) aren't allowed in URLs. Plugging this monster URL into your address bar will bring up a page like the one shown in Figure, with the fields already filled in.
Bookmark your newly created URL and give it a snappy name, such as "mail to bob!," and you'll have a shortcut to frequently sent mail.
Yahoo! Mail Bookmarklet
A prefilled Yahoo! Mail form
This code creates a Send Link bookmarklet that sends information via Yahoo! Mail about the current web page you're viewing. As with other bookmarklets in this book, first a nicely formatted version of the code is shown, with the usable bookmarklet code to follow:
As you can see, this bookmarklet builds the appropriate Yahoo! Mail URL, including a message subject and body in the URL. Both are escaped for URLs with the escape() function. The body includes the title of the current site, its URL, and any text that is selected on the page.
And here's the code formatted appropriately for a bookmarklet:
Running the hack.
Install the bookmarklet by creating a bookmark in your browser. Right-click the bookmark and choose Properties to edit the bookmark. In the Location field, paste the bookmarklet code and rename the bookmark Send Link!.
Imagine you'd like to send a friend a reference to the book pictured in Figure, along with the highlighted text describing the book.
From here, it's just a matter of filling in the To: field and clicking the Send button!