Send Gmail Drafts with Inline Images

50 views
Skip to first unread message

Darren D'Mello

unread,
Feb 7, 2021, 6:17:42 AM2/7/21
to Google Apps Script Community
Hello community,

The code posted here worked since a year ago, But I now see this issue. Does anyone have any workarounds or suggestions.



Thank you!

Martin Hawksey

unread,
Feb 7, 2021, 8:38:10 AM2/7/21
to google-apps-sc...@googlegroups.com
Hi Darren,

I've seen others solve this problem procedurally rather than with code. If the image is publicly visible and inserted in a certain way to the draft inline images should work. Here is some guidance provided to YAMM users https://sites.google.com/site/scriptsexamples/available-web-apps/mail-merge/documentation/known-issues/images-are-broken-in-emails-sent

Best
Martin

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/1a2caf12-b55c-4034-9d60-ed6c00f55c17n%40googlegroups.com.

Darren D'Mello

unread,
Feb 7, 2021, 10:02:48 PM2/7/21
to google-apps-sc...@googlegroups.com
Thank you so much Martin.

You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/9KUjtIOUhi8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/CAEZbQn_N89fxiOLej6m4D0ZGuLPqJHWCYEQNcBR8tiMibNpkCA%40mail.gmail.com.


--
Best,
Darren

Darren D'Mello

unread,
Feb 8, 2021, 12:35:14 AM2/8/21
to google-apps-sc...@googlegroups.com
--
Best,
Darren

Romain Vialard

unread,
Feb 8, 2021, 7:29:41 AM2/8/21
to Google Apps Script Community
Yeah, most of the resources you will find online on this subject are outdated.
Before, it was quite difficult to retrieve images from an existing draft and copy them in a new draft.
As shared on Labnol, you had to parse the raw content of the Gmail draft to find the images.

Google added the ability to easily retrieve the inline images in an existing draft via the getAttachments() method on October 30, 2018 (see Apps Script release notes).

Darren D'Mello

unread,
Feb 9, 2021, 2:09:43 AM2/9/21
to google-apps-sc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages