-
Notifications
You must be signed in to change notification settings - Fork 59
Description
Greetings.
Sorry for my bad english.
I suggest adding an [CC=email] field similar to [TO=email].
Template for insert in mail body looks like:
To: [[TO=email]]
CC: [[CC=email]]
Now I have to manually edit quicktextParser.mjs inside .xpi every time after addon's auto-update:
-
Add to
const allowedTags:
... , 'CC', ... -
After
process_toandget_toblocks and beforeasync parse(aStr) {block add:
(I add in a simpler format - without asking for full name - I only need to extract the addresses themselves, separated by commas):
async process_cc(aVariables) {
if (this.mData['CC'] && this.mData['CC'].checked)
return this.mData['CC'].data;
this.mData['CC'] = {};
this.mData['CC'].checked = true;
this.mData['CC'].data = { email: [] };
let details = await this.getDetails();
let emailAddresses = Array.isArray(details.cc) ? details.cc : (details.cc ? [details.cc] : []);
for (let i = 0; i < emailAddresses.length; i++) {
let contactData = await utils.parseDisplayName(emailAddresses[i]);
this.mData['CC'].data.email.push(contactData.email.toLowerCase());
}
return this.mData['CC'].data;
}
async get_cc(aVariables) {
let data = await this.process_cc(aVariables);
if (typeof data[aVariables[0]] != 'undefined') {
let mainSep = (aVariables.length > 1) ? aVariables[1].replace(/\n/g, "\n").replace(/\t/g, "\t") : ", ";
let lastSep = (aVariables.length > 2) ? aVariables[2].replace(/\n/g, "\n").replace(/\t/g, "\t") : mainSep;
let entries = data[aVariables[0]].slice(0);
let last = entries.pop();
let all = [];
if (entries.length > 0) all.push(entries.join(mainSep));
if (last) all.push(last);
return all.join(lastSep);
}
return "";
}
- Add to
switch (tags[i].tagName.toLowerCase()) {:
case 'cc':
Thanks for the great addon - it really helps in my work.