mirror of https://github.com/BTCPrivate/copay.git
Send email backup with file attached
This commit is contained in:
parent
053718884a
commit
e121d0acb6
|
@ -30,13 +30,14 @@ BackupService.prototype.download = function(wallet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// throw an email intent if we are in the mobile version
|
// throw an email intent if we are in the mobile version
|
||||||
if (window.xwalk) {
|
if (window.cordova) {
|
||||||
var name = wallet.name ? wallet.name + ' ' : '';
|
var name = wallet.name ? wallet.name + ' ' : '';
|
||||||
var partial = partial ? 'Partial ' : '';
|
var partial = partial ? 'Partial ' : '';
|
||||||
var subject = 'Copay - ' + name + 'Wallet ' + partial + 'Backup';
|
return window.plugin.email.open({
|
||||||
var body = 'This is the encrypted backup of the wallet ' + wallet.id + ':\n\n' + ew;
|
subject: 'Copay - ' + name + 'Wallet ' + partial + 'Backup',
|
||||||
var mailURL = encodeURI('mailto:?subject=' + subject + '&body=' + body);
|
body: 'Here is the encrypted backup of the wallet ' + wallet.id,
|
||||||
return window.open(mailURL,'_blank');
|
attachments: ['base64:' + filename + '//' + btoa(ew)]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise lean on the browser implementation
|
// otherwise lean on the browser implementation
|
||||||
|
|
Loading…
Reference in New Issue