0

I desperately try to find a way to remove the system label "Inbox" from emails that have another label (e.g. News) already assigned.

My idea behind is to have incoming messages first in the inbox and automatically labelled and secondly removed from the inbox but still labelled after a certain time point.

How can I make it conditional using:

function removeLabel (){for (var i = 0; i < labels.length; i++) {
    if (labels[i].getName().indexOf("Inbox") > -1) {
        //If the WORD is found in label name - delete the label
        labels[i].deleteLabel();}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.