9

Screenshot of the "Listen in Spotify" button in Gmail

This is the first time I've ever seen a button like this (see right side). Clicking on that button launches Spotify. How is Spotify able to do this for their emails? Can this be done with other applications right now?

Keavon
  • 5,460
  • 7
  • 43
  • 72
jetcom
  • 865
  • 5
  • 13
  • 20

2 Answers2

13

Disclaimer: I am a Spotify employee, but I haven't worked on this feature personally.

Google recently added support for markup that lets you embed interactive actions in your messages. You can see the blog post about this or the developer reference. The basic concept is that you embed some structured JSON data in your message, as in this example.

We embed markup in our notification emails that links to the Spotify Open site. For example, here's a link for Passenger — Holes: http://open.spotify.com/track/33lol6G1GUj0d3DyE1QzLw

If you have the Spotify desktop app installed, a redirect on that page to a spotify:track: URI will open the linked track in the desktop.

Rohan Singh
  • 16,731
  • 1
  • 37
  • 46
1

I would say that it is probably either a feature of Gmail or Spotify has installed some kind of browser plugin that inserts this button onto any page that it wants.

Just like torrents, browsers can associate certain header types with specific programs for example torrents use the magnet:// url which the browser associates with an installed bit torrent client.

So I would assume that this button launches a url like spotify://this-is-a-song-name-987897/ which launches the Spotify program on your computer.

M_Becker
  • 1,978
  • 2
  • 12
  • 10