Closed sam-higgs closed 1 week ago
You can send attachments that are stored on the device: https://github.com/EinfachHans/capacitor-email-composer?tab=readme-ov-file#device-storage
This doesn't appear to work for me, at least on iOS with something like:
const { uri } = Filesystem.writeFile({
path, // name of file
directory: Directory.Cache,
data, // JSON string
encoding: Encoding.UTF8,
});
...
await EmailComposer.open({ subject, attachments: [{ path: uri, type: "absolute", name: "foo.json" }] })
uri being something like "file:///var..." and the error is "File does not exist at absolute path"
@sam-higgs Can you try to remove the file://
at the beginning of the uri?
@EinfachHans Thanks, that seems to work!
It would be nice to be able to send attachments that are stored on device storage using https://capacitorjs.com/docs/apis/filesystem, this was previously possible with https://www.npmjs.com/package/cordova-plugin-email-composer?activeTab=readme