3
votes

Is there a way to open the GMail mail editor populated with some data (subject, part of the body, recipients) from a script ? A script that is activated by a button or a menu item in the GMail UI.

I need this to:

  • automate some manual task
  • and to mimic email templates

I do not want to send the email from the script, I want the user to complete and review the email before sending.

Thanks !

2

2 Answers

0
votes

Would it be okay if a user has to click a link?

http://www.askdavetaylor.com/can_i_have_a_mailto_link_specify_a_subject_and_body.html

This works for me, but I have Gmail handling mailto: links.

An alternate implementation would be to display a UI to the user showing the email preview, asking for a confirmation, then, upon confirmation, to send the email on behalf of the user. The drawback to this approach is that if the user needs to edit the email before sending, you will need to provide a UI with edit capabilities.

0
votes

Another approach would be to create a draft email using Apps Script that the user can find in the UI, edit, and send.