write using 'to', 'cc' or 'bcc'
write to multiple selected contacts using 'to', 'cc' or 'bcc' Feauture Request #3548
This commit is contained in:
parent
8efd01d55e
commit
ed62670a1a
|
@ -319,7 +319,7 @@
|
|||
vm.selectedFolder.$filter('');
|
||||
}
|
||||
|
||||
function newMessage($event, recipients) {
|
||||
function newMessage($event, recipients, recipientsField) {
|
||||
Account.$findAll().then(function(accounts) {
|
||||
var account = _.find(accounts, function(o) {
|
||||
if (o.id === 0)
|
||||
|
@ -330,7 +330,16 @@
|
|||
// list before proceeding with message's creation
|
||||
account.$getMailboxes().then(function(mailboxes) {
|
||||
account.$newMessage().then(function(message) {
|
||||
angular.extend(message.editable, { to: recipients });
|
||||
switch(recipientsField) {
|
||||
case 0:
|
||||
angular.extend(message.editable, { to: recipients });
|
||||
break;
|
||||
case 1:
|
||||
angular.extend(message.editable, { cc: recipients });
|
||||
break;
|
||||
case 2:
|
||||
angular.extend(message.editable, { bcc: recipients });
|
||||
}
|
||||
$mdDialog.show({
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: $event,
|
||||
|
@ -351,12 +360,12 @@
|
|||
|
||||
function newMessageWithRecipient($event, recipient, fn) {
|
||||
var recipients = [fn + ' <' + recipient + '>'];
|
||||
vm.newMessage($event, recipients);
|
||||
vm.newMessage($event, recipients, 0);
|
||||
$event.stopPropagation();
|
||||
$event.preventDefault();
|
||||
}
|
||||
|
||||
function newMessageWithSelectedCards($event) {
|
||||
function newMessageWithSelectedCards($event, recipientsField) {
|
||||
var selectedCards = _.filter(vm.selectedFolder.$cards, function(card) { return card.selected; });
|
||||
var promises = [], recipients = [];
|
||||
|
||||
|
@ -386,7 +395,7 @@
|
|||
$q.all(promises).then(function() {
|
||||
recipients = _.uniq(recipients);
|
||||
if (recipients.length)
|
||||
vm.newMessage($event, recipients);
|
||||
vm.newMessage($event, recipients, recipientsField);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue