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

Aperta
#545 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
desktop

Direzione di ricerca

The change belongs in quicktextParser.mjs: add 'CC' to allowedTags, mirror the existing process_to and get_to pair with process_cc and get_cc, and add a case 'cc': to the tag switch in parse. Check how the TO handling reads this.mData and getDetails() first, because the reporter's snippet may not match the current code. Done means a template containing [[CC=email]] renders the CC addresses as [[TO=email]] does.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

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.

Lingua principale
JavaScript
Stelle
283
Fork
62
Merge medio
1m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jobisoft/quicktext

Tutte le issue di jobisoft/quicktext

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.