Question

I want to create a google app that will let you add a file from a cloud service as an attachment to an email. From reading the google documentations it seems like you can't do anything while the user is creating an email, but the attachments.me app is able to do it. When composing an email, their app will pop up a button next to the regular attachment app letting you select an attachment from the cloud. I am new to working with google apps and I do not understand how attachments.me is able to do this. If anyone has an idea as to how this is possible please let me know, thanks.

Was it helpful?

Solution

To add features to the GMail UI you'd probably have to implement this as a Chrome extension (and/or Firefox or IE extension to support those browsers). In fact, this is apparently how attachments.me does it.

What the extension does is load when you go to gmail.com, identify a place in the UI where it wants to add its button(s), and inject them using JavaScript. You may then want to use JavaScript again to do something like add a link to the text of the email before it gets sent to the media you want to attach from the cloud, or intercept the "Send" button to tell your server to send the message with the cloud attachment included (assuming the user has authorized your server to send as them -- this can have serious security implications)

Beware, modifying complex web app UIs like GMail's using a Chrome extension can be very difficult; GMail may make changes that break your UI or functionality, and they may do it whenever they want, or only to a subset of users, so you'll have to constantly keep up with these changes to fix bugs. All in all I don't recommend it as a way of adding attachments to emails.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top