EinfachHans/capacitor-email-composer

JSON as attachment

wimZ opened this issue · 4 comments

wimZ commented

Would it be possible to add the possibility to attach a large text i.e. a stringified JSON object,

I would like to avoid the cycle through the file system.

Kind regards
wim

What would you expect exactly? 🤔 Passing a JSON string which should be added as a .json file?

wimZ commented

The simple answer is yes.

I currently capture data in json format and need to store it first as file before attaching, and the removing the file again.

SO my suggestion is for the ability to specify an attachment like below :
EmailComposer.open({
to: ['email@xyz.com'],
subject: "",
body: "text",
attachments: [
{
type: 'absolute',
filename: "xyz.json",
content: ""
},
],
})

You could use base64, couldn't you? 🤔 This should work without need to really store the file on the device

wimZ commented

I overlooked this option completely. It works like a charm.

Apologize for bothering.