{"record":{"id":"50ba2fe65b72f412","repo":"BerriAI/litellm","slug":"trying-to-customize-email-alerting-commonproxyer","errorCode":null,"errorMessage":"Trying to Customize Email Alerting\n {CommonProxyErrors.not_premium_user.value}","messagePattern":"Trying to Customize Email Alerting\n (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/SlackAlerting/slack_alerting.py","lineNumber":1088,"sourceCode":"        )\n        if response.status_code == 200:\n            return True\n        else:\n            print(\"Error sending webhook alert. Error=\", response.text)  # noqa: T201\n\n        return False\n\n    async def _check_if_using_premium_email_feature(\n        self,\n        premium_user: bool,\n        email_logo_url: str | None = None,\n        email_support_contact: str | None = None,\n    ):\n        from litellm.proxy.proxy_server import CommonProxyErrors, premium_user\n\n        if premium_user is not True:\n            if email_logo_url is not None or email_support_contact is not None:\n                raise ValueError(f\"Trying to Customize Email Alerting\\n {CommonProxyErrors.not_premium_user.value}\")\n\n    async def _construct_user_invitation_link(self, recipient_user_id: str | None, base_url: str) -> str:\n        from litellm.proxy.management_helpers.user_invitation import (\n            create_invitation_for_user,\n        )\n        from litellm.proxy.proxy_server import prisma_client\n\n        if recipient_user_id is None or prisma_client is None:\n            return base_url\n\n        try:\n            existing_invitations: Final = TypeAdapter(list[InvitationModel]).validate_python(\n                await InvitationLinkRepository(prisma_client).table.find_many(  # pyright: ignore[reportAny]  # untyped prisma boundary (any-ok), result validated by TypeAdapter\n                    where={\"user_id\": recipient_user_id},  # mutable-ok: prisma find_many requires a dict where filter\n                    order={\"created_at\": \"desc\"},  # mutable-ok: prisma find_many requires a dict order arg\n                ),\n                from_attributes=True,\n            )","sourceCodeStart":1070,"sourceCodeEnd":1106,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/integrations/SlackAlerting/slack_alerting.py#L1070-L1106","documentation":"The litellm proxy checks alerting customization at startup/handler init: if the deployment is not premium (no enterprise license resolving premium_user=True) yet the alerting config sets email_logo_url or email_support_contact, a ValueError is raised (litellm/integrations/SlackAlerting/slack_alerting.py:1081-1088). These email-branding fields are enterprise-tier features.","triggerScenarios":"Adding email_logo_url or email_support_contact under alerting in the proxy config without an enterprise LITELLM_LICENSE key; copying an enterprise example config into a community deployment; license env var present but invalid so premium_user resolves False.","commonSituations":"Trialing the email branding shown in enterprise docs; expired/removed license keys after a trial; k8s secret with the license not mounted so premium check fails.","solutions":["Remove email_logo_url and email_support_contact from the alerting config on community litellm.","Or obtain an enterprise license and set LITELLM_LICENSE so premium_user is True.","If you have a license, verify it is actually loaded (correct env var/secret, not expired) since the check is premium_user is not True.","Keep enterprise-only keys in a separate overlay config applied only to licensed deployments."],"exampleFix":"# before (litellm_config.yaml)\nlitellm_settings:\nalerting:\n  email_logo_url: \"https://corp/logo.png\"\n# ValueError: Trying to Customize Email Alerting ...\n\n# after\nalerting: []  # community build: drop email branding keys\n# or set LITELLM_LICENSE=<enterprise key> and keep the branding fields","handlingStrategy":"validation","validationCode":"# config-level guard before deploying community litellm\nimport yaml\n\ncfg = yaml.safe_load(open(\"litellm_config.yaml\"))\nalerting = cfg.get(\"litellm_settings\", {}).get(\"alerting\") or cfg.get(\"alerting\") or {}\nhas_license = bool(os.getenv(\"LITELLM_LICENSE\"))\nif not has_license:\n    text = str(alerting)\n    assert \"email_logo_url\" not in text and \"email_support_contact\" not in text, \\\n        \"email branding fields require an enterprise license; remove them\"","typeGuard":null,"tryCatchPattern":"try:\n    await alerting._check_if_using_premium_email_feature(premium_user, email_logo_url, email_support_contact)\nexcept ValueError as e:\n    if \"not_premium_user\" in str(e) or \"Customize Email Alerting\" in str(e):\n        # drop enterprise-only email branding and continue\n        email_logo_url = email_support_contact = None\n    else:\n        raise","preventionTips":["Keep enterprise-only config keys in a separate overlay applied only to licensed deployments.","CI-validate the proxy config against the deployment tier (community vs enterprise).","If licensed, verify LITELLM_LICENSE actually loads (premium_user True) before enabling branding."],"tags":["litellm","proxy","alerting","enterprise","licensing","email"],"backgroundTag":"premium-feature-required","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}