mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Merge pull request #1286 from rezaei92/master
Sending group email to all contact addresses
This commit is contained in:
commit
65d469f71a
5 changed files with 42 additions and 3 deletions
|
|
@ -86,6 +86,7 @@ export class ContactModel extends AbstractModel {
|
||||||
focused: false,
|
focused: false,
|
||||||
selected: false,
|
selected: false,
|
||||||
checked: false,
|
checked: false,
|
||||||
|
sendToAll: true,
|
||||||
|
|
||||||
deleted: false,
|
deleted: false,
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
|
|
@ -139,7 +140,16 @@ export class ContactModel extends AbstractModel {
|
||||||
*/
|
*/
|
||||||
getNameAndEmailHelper() {
|
getNameAndEmailHelper() {
|
||||||
let name = (this.givenName() + ' ' + this.surName()).trim(),
|
let name = (this.givenName() + ' ' + this.surName()).trim(),
|
||||||
|
email;
|
||||||
|
|
||||||
|
if (this.sendToAll()) {
|
||||||
|
email = [];
|
||||||
|
this.email().forEach(function (key){
|
||||||
|
email.push(key?.value())
|
||||||
|
});
|
||||||
|
} else {
|
||||||
email = this.email()[0]?.value();
|
email = this.email()[0]?.value();
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
// this.jCard.getOne('fn')?.notEmpty() ||
|
// this.jCard.getOne('fn')?.notEmpty() ||
|
||||||
this.jCard.parseFullName({set:true});
|
this.jCard.parseFullName({set:true});
|
||||||
|
|
@ -222,6 +232,9 @@ export class ContactModel extends AbstractModel {
|
||||||
value: ko.observable('')
|
value: ko.observable('')
|
||||||
// type: prop.params.type
|
// type: prop.params.type
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.sendToAllDisplayStatus())
|
||||||
|
document.getElementById('send-to-all').style.display = 'block';
|
||||||
}
|
}
|
||||||
|
|
||||||
addTel() {
|
addTel() {
|
||||||
|
|
@ -318,4 +331,13 @@ export class ContactModel extends AbstractModel {
|
||||||
+ (this.checked() ? ' checked' : '')
|
+ (this.checked() ? ' checked' : '')
|
||||||
+ (this.focused() ? ' focused' : '');
|
+ (this.focused() ? ' focused' : '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendToAllDefaultValue() {
|
||||||
|
return (this.sendToAll() ? ' checked' : '');
|
||||||
|
}
|
||||||
|
|
||||||
|
sendToAllDisplayStatus() {
|
||||||
|
return this.email.length > 1
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,10 +166,15 @@
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input, textarea {
|
input:not([type='checkbox']), textarea {
|
||||||
width: 70vw;
|
width: 70vw;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#send-to-all > input[type="checkbox"] {
|
||||||
|
margin-left: 2px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.read-only-sign {
|
.read-only-sign {
|
||||||
|
|
|
||||||
|
|
@ -1382,6 +1382,12 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let sToAddress = this.to();
|
||||||
|
|
||||||
|
if (/".*" <.*,.*>/g.test(sToAddress)) {
|
||||||
|
sToAddress = sToAddress.match(/<.*>/g)[0].replace(/[<>]/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
const
|
const
|
||||||
identity = this.currentIdentity(),
|
identity = this.currentIdentity(),
|
||||||
params = {
|
params = {
|
||||||
|
|
@ -1390,7 +1396,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
messageUid: this.draftUid(),
|
messageUid: this.draftUid(),
|
||||||
saveFolder: sSaveFolder,
|
saveFolder: sSaveFolder,
|
||||||
from: this.from(),
|
from: this.from(),
|
||||||
to: this.to(),
|
to: sToAddress,
|
||||||
cc: this.cc(),
|
cc: this.cc(),
|
||||||
bcc: this.bcc(),
|
bcc: this.bcc(),
|
||||||
replyTo: this.replyTo(),
|
replyTo: this.replyTo(),
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,8 @@
|
||||||
"ADD_MENU_BIRTHDAY": "Birthday",
|
"ADD_MENU_BIRTHDAY": "Birthday",
|
||||||
"ADD_MENU_TAGS": "Tags",
|
"ADD_MENU_TAGS": "Tags",
|
||||||
"BUTTON_SHARE_ALL": "Everyone",
|
"BUTTON_SHARE_ALL": "Everyone",
|
||||||
"BUTTON_SYNC": "Synchronization (CardDAV)"
|
"BUTTON_SYNC": "Synchronization (CardDAV)",
|
||||||
|
"SEND_TO_ALL_CONTACT_EMAILS": "Send to all contact emails"
|
||||||
},
|
},
|
||||||
"COMPOSE": {
|
"COMPOSE": {
|
||||||
"LINK_SHOW_INPUTS": "show all fields",
|
"LINK_SHOW_INPUTS": "show all fields",
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,11 @@
|
||||||
<div class="control-group" data-bind="email().length">
|
<div class="control-group" data-bind="email().length">
|
||||||
<label class="fontastic iconsize24" data-i18n="[title]GLOBAL/EMAIL">@</label>
|
<label class="fontastic iconsize24" data-i18n="[title]GLOBAL/EMAIL">@</label>
|
||||||
<div>
|
<div>
|
||||||
|
<div id="send-to-all" class="property-line" data-bind="visible: sendToAllDisplayStatus()">
|
||||||
|
<input type="checkbox" data-bind="checked: sendToAll, css: sendToAllDefaultValue()">
|
||||||
|
<span data-i18n="CONTACTS/SEND_TO_ALL_CONTACT_EMAILS"></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-bind="foreach: email">
|
<div data-bind="foreach: email">
|
||||||
<div class="property-line">
|
<div class="property-line">
|
||||||
<span data-bind="text: value"></span>
|
<span data-bind="text: value"></span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue