Revert "Add toggle for email notifications"

This commit is contained in:
Jason Dreyzehner 2016-10-28 12:07:59 -04:00 committed by GitHub
commit 9fb1302661
6 changed files with 49 additions and 100 deletions

View file

@ -1,36 +0,0 @@
'use strict';
angular.module('copayApp.services').factory('emailService', function($log, configService, profileService, lodash, walletService) {
var root = {};
root.enableEmailNotifications = function(val) {
val = val || false;
var config = configService.getSync();
if (!config.emailFor) {
$log.debug('No email configuration available');
return;
}
var keys = lodash.keys(config.emailFor);
var wallets = lodash.map(keys, function(k) {
return profileService.getWallet(k);
});
if (!wallets) {
$log.debug('No wallets found');
return;
}
lodash.each(wallets, function(w) {
walletService.updateRemotePreferences(w, {
email: val ? config.emailFor[w.credentials.walletId] : null
}, function(err) {
if (err) $log.warn(err);
});
});
};
return root;
});