Ever since Google announced that they were bringing generative AI features to Gmail, I’ve been super excited. Having an AI assistant help with email overflow seems like an amazing use case (though of course, there are privacy concerns).
But in the months since, I’ve been underwhelmed, to be honest. And I finally got tired of waiting for Google. So I built a Chrome Extension to let ChatGPT read and summarize my email.
A game plan for Gmail
As someone who’s never built a Chrome Extension before, I was scratching my head on where to start. At their core, extensions are “just” bundles of HTML, CSS, and JavaScript - but I didn’t know how that translated to actually getting ChatGPT into my inbox.
That’s when I discovered InboxSDK, which was a game changer. I’ll explain more below, but the library does much of the heavy lifting for building Gmail extensions.
And with that in mind, I now had a game plan. There were two things that I wanted this first version to do: summarize an email thread, and let me ask specific questions about the email thread. Here are the stepping stones to getting there:
Build a Gmail sidebar to interact with ChatGPT, using InboxSDK and Chrome Extension libraries.
Create the sidebar UI with buttons, inputs, and text areas.
Make summarization work first: send the email body to ChatGPT along with a prompt, and display the summarized response.
Make Q&A work next: keep track of a conversation with ChatGPT along with the email contents, and display the answers coherently.
Consider additional features like changing models or saving settings.
Let’s get started!