I am trying to create essentially a new send button for my GMail add-on but I am unsure if it is possible.
The send function requires an object to send but I can not find a way to grab the email being currently composed so i have tried sending the draft that corresponds to the email being composed.
var draft = GmailApp.getDrafts()[0]; // The first draft message in the drafts folder
var msg = draft.send(); // Send it
This half works as it sends the email in the background but the compose window stays open so its hard to tell its sent and further more there are cases where the composed email either does not get saved as a draft or it is not at the top of the saved drafts.
Is there anyway to send the email currently being composed?