Is there any way to add attachments to the current compose UI from Gmail add-ons. Options are available to update the mail body, subject, and mail-id
var response = CardService.newUpdateDraftActionResponseBuilder()
.setUpdateDraftBodyAction(CardService.newUpdateDraftBodyAction()
.addUpdateContent(
imageHtmlContent,
CardService.ContentType.MUTABLE_HTML)
.setUpdateType(
CardService.UpdateDraftBodyType.IN_PLACE_INSERT))
.build();
I have found a way to add attachments to the current mail in the draft. However, after adding the attachment in the draft, the same is not reflected in the compose UI. After refreshing the browser, the attachment is getting displayed in the compose UI.
var currentDraftMail = GmailApp.getDrafts()[0];
currentDraftMail.update(recipient, subj, msgBody+"<h1>Mail updated </h1>", {
attachments: mailattachments,
cc: ccList,
bcc: bccList,
});
Is there any way to add attachments to the current compose UI windows without refreshing?