Tuesday, February 18, 2014

Embed an image in your Google Apps signature using Google Drive

A recent update to Google Drive has broken this method of inserting images. To see updated instructions, click here.

If you're used to Outlook or other traditional mail clients, Google Apps' signature can be a little confounding at first blush. Inserting an image looks like it should be as easy as clicking a button and choosing the image you'd like. However, if you click the insert image button, what you'll see instead is this:


Now you're stuck unless you use third-party image hosters like imgur, ImageShack, or Photobucket. While these products work just fine for general hosting, they might be blocked by corporate firewalls, or cause a host of other problems. But are you really stuck?

As is usually the case when Google goes against the grain, there's a reason why they've chosen this route rather than the "traditional" route of attaching an image file to each email you send. The first is the obvious one--it saves you from actually having a file attachment on each message you send, which reduces e-mail message sizes. Secondly, and more importantly, it helps you avoid having your messages sent to spam. Many mail servers look for images attached to messages as a sort of "flag" that the message might be spam.

Luckily, if you use Google Apps for Business (or, indeed, a free Gmail account), you have the Google Drive cloud storage application to help you out. First, find the image you'd like to use in your signature and upload it to your Drive. Next, ensure that the image is shared publicly (with view-only rights, not edit rights), so that anyone you send emails to will be able to see the image without having to be signed into a Google Account.


Once you click "Save", you should be taken back to the initial sharing dialogue box, which will show you who the file is currently shared with along with the URL to access it in a text box along the top. What we need here is the File ID, which is the two-part string of characters in between /d/ and /edit, as seen below:


Now, we need to trick Google Drive into thinking we're exporting the image, so that we can access it outside of the standard Google Drive image viewer. To do so, we'll use this URL: http://drive.google.com/uc?export=view&id=<FileID>. Here, we replace <FileID> with the text highlighted in red above. So we'll use http://drive.google.com/uc?export=view&id=0B_T9jgOMjQ5lN2Z4UWhpZGRTM1E. To test if you've got the right image, simply copy and paste your URL into your browser's address bar and hit enter. If you see only the image show up, then you've done it correctly, and can use this URL to insert an image into your signature.


Go back to your signature editor, click the Insert Image button, and paste in the URL we generated a moment ago. If you see the image load in a preview just below the URL box (it might take a few seconds if it's a large image), then you've got the right URL. Click OK, and you're done! That image will now be linked in your signature, won't take up extra space, and shouldn't trigger spam filters.

All this work saves you from having an attachment on every message you send, which certain spam filters don't like, and will allow you to quickly and easily change your signature's image, as long as you use the "export" URL listed above.