Coverage for fastid / email / config.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.13.1, created at 2026-10-18 16:37 +0000

1from pydantic import Field 

2 

3from fastid.core.config import branding_settings 

4from fastid.core.schemas import BaseSettings 

5 

6 

7class EmailSettings(BaseSettings): 

8 smtp_enabled: bool = False 

9 smtp_ssl: bool = False 

10 smtp_host: str = "mailpit" 

11 smtp_port: int = 1025 

12 smtp_auth: bool = False 

13 smtp_username: str = "user@example.com" 

14 smtp_password: str = "password" 

15 smtp_from_email: str = Field(default_factory=lambda data: data["smtp_username"]) 

16 

17 @property 

18 def smtp_from(self) -> str: 

19 return f"{branding_settings.notify_from} <{self.smtp_from_email}>" 

20 

21 

22email_settings = EmailSettings()