I’m trying to add a custom button to the Gmail compose window toolbar. I know some Gmail Labs features do this, like the ‘Send & Archive’ option. But I can’t find anything in the official docs about it.
I’ve looked at the sidebar gadgets and contextual gadgets, but they don’t seem to do what I want. Has anyone figured out how to add toolbar buttons?
If it’s not possible with the Gmail API, are there other ways? Maybe a Chrome extension or a user script could work?
Any tips or ideas would be super helpful. I’m not sure where to start with this. Thanks!
Hey, i’ve actually done smthing similar! Chrome extensions r ur best bet. u can inject custom HTML into the compose window. it’s a bit tricky to get the styling right, but totally doable. just watch out for gmail updates breaking things. good luck!
I’ve tackled this issue before, and while Gmail doesn’t officially support custom toolbar buttons, there’s a workaround using Google Apps Script. It’s less prone to breaking with Gmail updates compared to Chrome extensions.
Here’s the gist: create a Google Apps Script project, use the Gmail service to add a custom menu item to the Gmail interface, and then link that to a function that modifies your draft or performs other actions.
The downside is it adds a menu item rather than a toolbar button, but it’s reliable and doesn’t require users to install anything. Plus, you can deploy it as a web app for team-wide use.
If you’re set on a toolbar button, a Chrome extension is indeed your best bet, but be prepared for potential maintenance as Gmail evolves.
As someone who’s dabbled in Gmail customization, I can tell you that adding a custom button to the compose toolbar isn’t straightforward through official channels. However, I’ve had success using a Chrome extension for this purpose.
I created a simple extension that injects a custom button into the compose window. It required some JavaScript to detect when the compose window opens and then insert the HTML for the button. The tricky part was making it look and behave like native Gmail buttons.
For the button’s functionality, I used Gmail’s API to interact with the draft. This allowed me to modify the email content or trigger actions when the button was clicked.
It’s not a perfect solution - updates to Gmail’s interface can break it. But for my needs, it’s been a reliable way to add custom functionality to the compose experience. If you’re comfortable with web development, this approach might work for you too.