feat(mail(web)): Templates folder for pre-defined drafts

To create a template, the user needs to:

 - define a mailbox as the Templates folder;
 - move a draft to this special folder.

Fixes #4320
Fixes #5363
This commit is contained in:
Francis Lachapelle
2022-02-11 09:45:54 -05:00
parent 02b0a41567
commit c986422a3d
25 changed files with 230 additions and 9 deletions
@@ -304,7 +304,6 @@
this.addRecipient = function (contact, field) {
var recipients, recipient, list, i, address;
var emailRE = /([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)/i;
recipients = this.message.editable[field];
@@ -319,7 +318,7 @@
contact.charCodeAt(i) == 32 || // space
contact.charCodeAt(i) == 44 || // ,
contact.charCodeAt(i) == 59) && // ;
emailRE.test(address) &&
address.isValidEmail() &&
recipients.indexOf(address) < 0) {
recipients.push(address);
address = '';