mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Sending group email to all contact addresses
This commit is contained in:
parent
9a4b73e819
commit
73dd4677da
5 changed files with 42 additions and 3 deletions
|
|
@ -86,6 +86,7 @@ export class ContactModel extends AbstractModel {
|
|||
focused: false,
|
||||
selected: false,
|
||||
checked: false,
|
||||
sendToAll: true,
|
||||
|
||||
deleted: false,
|
||||
readOnly: false,
|
||||
|
|
@ -139,7 +140,16 @@ export class ContactModel extends AbstractModel {
|
|||
*/
|
||||
getNameAndEmailHelper() {
|
||||
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();
|
||||
}
|
||||
/*
|
||||
// this.jCard.getOne('fn')?.notEmpty() ||
|
||||
this.jCard.parseFullName({set:true});
|
||||
|
|
@ -222,6 +232,9 @@ export class ContactModel extends AbstractModel {
|
|||
value: ko.observable('')
|
||||
// type: prop.params.type
|
||||
});
|
||||
|
||||
if (this.sendToAllDisplayStatus())
|
||||
document.getElementById('send-to-all').style.display = 'block';
|
||||
}
|
||||
|
||||
addTel() {
|
||||
|
|
@ -318,4 +331,13 @@ export class ContactModel extends AbstractModel {
|
|||
+ (this.checked() ? ' checked' : '')
|
||||
+ (this.focused() ? ' focused' : '');
|
||||
}
|
||||
|
||||
sendToAllDefaultValue() {
|
||||
return (this.sendToAll() ? ' checked' : '');
|
||||
}
|
||||
|
||||
sendToAllDisplayStatus() {
|
||||
return this.email.length > 1
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,10 +166,15 @@
|
|||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
input[type='text'], textarea {
|
||||
width: 70vw;
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
#send-to-all > input[type="checkbox"] {
|
||||
margin-left: 2px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.read-only-sign {
|
||||
|
|
|
|||
|
|
@ -1381,6 +1381,12 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
}
|
||||
});
|
||||
|
||||
let sToAddress = this.to();
|
||||
|
||||
if (/".*" <.*,.*>/g.test(sToAddress)) {
|
||||
sToAddress = sToAddress.match(/<.*>/g)[0].replace(/[<>]/g, '');
|
||||
}
|
||||
|
||||
const
|
||||
identity = this.currentIdentity(),
|
||||
params = {
|
||||
|
|
@ -1389,7 +1395,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
messageUid: this.draftUid(),
|
||||
saveFolder: sSaveFolder,
|
||||
from: this.from(),
|
||||
to: this.to(),
|
||||
to: sToAddress,
|
||||
cc: this.cc(),
|
||||
bcc: this.bcc(),
|
||||
replyTo: this.replyTo(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue