My code is below but the draft just doesn’t include the attachment. The draft is successful otherwise.
const createDraft1 = await.Front.createDraft({ to: t'acme@example.com'], subject: "Your invoice for the order: ", attachments: t'./X.pdf', 'path/X.pdf'], content: { body: 'Invoice attached.', type: 'text' } });
Page 1 / 1
It looks like the attachments array only accepts an absolute file path. If you create the draft with only an absolute path, does it upload the attachment then?
--Sam
I have the absolute file path and yet still no attachment in the draft.
I log the result and the attachment key/value doesn't even show up (I was expecting an undefined or something like bcc and cc).
I've been testing with an empty txt document as I thought maybe it could have been a size issue.
Any ideas?
In the code you shared, it looks like you're providing only a string "/path...", rather than the File object itself.
Have you tried reading the file itself into memory using something like the File System Access API?
I got the chance to look at this again - Still no Luck.
I have tried fetching an image and attaching it with no luck.
I have even turned the file object into a downloadable link so I know the fetch works.