{"record":{"id":"84f017894c2abcd6","repo":"Foundry376/Mailspring","slug":"unknown-mail-rule-condition-template-condition","errorCode":null,"errorMessage":"Unknown mail rule condition template: ${condition.templateKey}","messagePattern":"Unknown mail rule condition template: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/mail-rules-processor.ts","lineNumber":226,"sourceCode":"      for (const t of ConditionTemplates) {\n        this._conditionTemplateMap.set(t.key, t);\n      }\n    }\n    return this._conditionTemplateMap;\n  }\n\n  _checkRuleForMessage(rule: MailRule, message: Message) {\n    const fn =\n      rule.conditionMode === ConditionMode.All ? Array.prototype.every : Array.prototype.some;\n    if (message.accountId !== rule.accountId) {\n      return false;\n    }\n\n    const templateMap = this._getConditionTemplateMap();\n    return fn.call(rule.conditions, (condition) => {\n      const template = templateMap.get(condition.templateKey);\n      if (!template) {\n        console.warn(`Unknown mail rule condition template: ${condition.templateKey}`);\n        return false;\n      }\n      const value = template.valueForMessage(message);\n      return template.evaluate(condition, value);\n    });\n  }\n\n  async _applyRuleToMessage(rule: MailRule, message: Message, thread: Thread) {\n    try {\n      const actionPromises = rule.actions.map((action) => {\n        const actionFn = MailRulesActions[action.templateKey];\n        if (!actionFn) {\n          throw new Error(`${action.templateKey} is not a supported action.`);\n        }\n        return actionFn(message, thread, action.value);\n      });\n\n      const actionResults = await Promise.all<Task | undefined>(actionPromises);","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/mail-rules-processor.ts#L208-L244","documentation":"Warning (not a throw) logged by _checkRuleForMessage when a stored rule condition references a templateKey absent from the ConditionTemplates registry — e.g. a rule created by a different app version or removed condition type. The condition cannot be evaluated, so it cannot contribute to the rule matching.","triggerScenarios":"Thrown at app/src/mail-rules-processor.ts:226 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Edit the rule in Preferences > Mail Rules and re-select the condition","Update Mailspring to a version that includes the condition template","Delete and recreate the affected rule"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}