add send logs by email

This commit is contained in:
Matias Alejo Garcia 2015-04-25 21:08:19 -03:00
commit 3abfb65087
2 changed files with 25 additions and 4 deletions

View file

@ -1,4 +1,10 @@
<div class="content p20v" ng-controller="preferencesLogs as logs">
<button class="black radius expand" ng-show="logs.isCordova" ng-style="{'background-color':index.backgroundColor}" ng-click="logs.sendLogs()" ><i class="fi-mail"></i>
<span translate>Send by email</span>
</button>
<ul class="no-bullet m0 size-14">
<li class="line-b" ng-repeat="l in logs.logs">

View file

@ -1,7 +1,22 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesLogs',
function(historicLog) {
this.logs = historicLog.get();
console.log('[preferencesLogs.js.5:historicLog:]',this.logs); //TODO
});
function(historicLog, isCordova) {
this.logs = historicLog.get();
this.isCordova = isCordova;
this.sendLogs = function() {
var body = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n Copay v' + window.version + ' #' + window.commitHash;
body += '\n\n'
body += this.logs.map(function(v) {
return v.msg;
}).join('\n');
var properties = {
subject: 'Copay Logs',
body: body,
isHtml: false
};
window.plugin.email.open(properties);
};
});