Web service initiated
This commit is contained in:
32
Controllers/Email/config.py
Normal file
32
Controllers/Email/config.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Configs(BaseSettings):
|
||||
"""
|
||||
Email configuration settings.
|
||||
"""
|
||||
|
||||
HOST: str = ""
|
||||
USERNAME: str = ""
|
||||
PASSWORD: str = ""
|
||||
PORT: int = 0
|
||||
SEND: bool = False
|
||||
|
||||
@property
|
||||
def is_send(self):
|
||||
return bool(self.SEND)
|
||||
|
||||
@classmethod
|
||||
def as_dict(cls):
|
||||
return dict(
|
||||
host=cls.EMAIL_HOST,
|
||||
port=cls.EMAIL_PORT,
|
||||
username=cls.EMAIL_USERNAME,
|
||||
password=cls.EMAIL_PASSWORD,
|
||||
)
|
||||
|
||||
model_config = SettingsConfigDict(env_prefix="EMAIL_")
|
||||
|
||||
|
||||
# singleton instance of the POSTGRESQL configuration settings
|
||||
email_configs = Configs()
|
||||
Reference in New Issue
Block a user