Skip to main content

Remove Thread Label

This example demonstrates the usage of the action thread.removeLabel. It is also used to test a possible behavioral change for certain characters in label names (e.g. - vs. /).

👉 Edit this example in the playground.

{
"description": "The action `thread.removeLabel` removes a label from a thread.",
"global": {
"thread": {
"match": {
"query": "from:${user.email} to:${user.email} after:${date.now:date::yyyy-MM-dd} subject:'[GmailProcessor-Test] actionThreadRemoveLabel'"
}
}
},
"settings": {
"markProcessedMethod": "custom"
},
"threads": [
{
"match": {
"query": "subject:([GmailProcessor-Test] actionThreadRemoveLabel)"
},
"actions": [
{
"name": "thread.addLabel",
"processingStage": "pre-main",
"args": {
"name": "accounting-process"
}
},
{
"name": "thread.markRead",
"processingStage": "post-main"
},
{
"name": "thread.removeLabel",
"processingStage": "post-main",
"args": {
"name": "accounting-process"
}
},
{
"name": "thread.addLabel",
"processingStage": "post-main",
"args": {
"name": "accounting-autoinvoice"
}
}
]
}
]
}

Source: actionThreadRemoveLabel.ts | Issues: #303