{"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":"validation","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/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/SlackAlerting/slack_alerting.py#L1070-L1106","documentation":"Customizing email alert branding (email_logo_url or email_support_contact) is an enterprise/premium feature. _check_if_using_premium_email_feature raises ValueError when these parameters are set but premium_user is not True (litellm/integrations/SlackAlerting/slack_alerting.py:1088).","triggerScenarios":"Configuring alerting with email_logo_url or email_support_contact in litellm proxy config while not running with a premium/enterprise license; premium flag not propagated (e.g., stale env var LITELLM_PREMIUM or missing license) on a proxy that is actually licensed.","commonSituations":"Copying enterprise config templates to an OSS deployment; license expired; premium_user detection failing behind a proxy where the metadata endpoint is unreachable.","solutions":["Remove email_logo_url and email_support_contact from the config to use default email alerting","If you have an enterprise license, ensure premium_user resolves True (valid license/metadata config) before these options are used","Contact litellm sales if you need branded email alerts","Check proxy startup logs for premium-user detection errors"],"exampleFix":"# before\nalerting: general_settings:\n  alerting: [\"email\"]\n  email_logo_url: \"https://cdn.acme.com/logo.png\"\n\n# after\nalerting: general_settings:\n  alerting: [\"email\"]  # default branding, no premium options","handlingStrategy":"validation","validationCode":"def email_customization_allowed(premium_user: bool, logo_url, support_contact) -> bool:\n    if not premium_user and (logo_url is not None or support_contact is not None):\n        return False\n    return True","typeGuard":null,"tryCatchPattern":"try:\n    await alerting.send_email_alert(...)\nexcept ValueError as e:\n    if \"not_premium_user\" in str(e) or \"Trying to Customize Email Alerting\" in str(e):\n        # strip premium email options and retry with defaults\n        raise","preventionTips":["Only set email_logo_url/email_support_contact on licensed enterprise deployments","Gate premium config keys behind a premium flag in your config loader","Verify premium_user detection at proxy startup"],"tags":["alerting","email","licensing","premium","proxy-config"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}