I have an ionic app where I want to send a csv file per email.
I'm usign ng-cordova and cordova-plugin-email-composer
$ionicPlatform.ready(function() {
$cordovaFile.writeFile( 'xy.csv', csvdata, {'append':false} ).then( function(result) {
if(window.cordova && window.cordova.plugins.email) {
window.cordova.plugins.email.open({
to: 'xyz@gmail.com',
subject: 'csv file',
body: 'data attached',
attachments: 'xy.csv'
});
}
})
};
I probably have to define the directory, but trying to use cordova.file.dataDirectory
always led to error from writeFile()
The Mail appears to have xy.csv attached, but when sending it always says 'Can't send attachment'
Thanks a lot for you help!