EinfachHans / capacitor-email-composer

E-Mail Composer Plugin for Capacitor
MIT License
21 stars 7 forks source link

JSON as attachment #27

Closed wimZ closed 10 months ago

wimZ commented 1 year ago

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

EinfachHans commented 10 months ago

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

wimZ commented 10 months ago

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: "" }, ], })

EinfachHans commented 10 months ago

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

wimZ commented 10 months ago

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

Apologize for bothering.