Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29935

How can I send the email currently being composed via code with GMail Addons

$
0
0

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?


Viewing all articles
Browse latest Browse all 29935

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>