Skip to content

Feature Request: Add an [CC=email] similar to [TO=email] #545

@Froz0925

Description

@Froz0925

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:

  1. Add to const allowedTags:
    ... , 'CC', ...

  2. After process_to and get_to blocks and before async 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 "";
}

  1. Add to switch (tags[i].tagName.toLowerCase()) { :
    case 'cc':

Thanks for the great addon - it really helps in my work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions