diff --git a/packages/syft/src/syft/service/notifier/notifier.py b/packages/syft/src/syft/service/notifier/notifier.py index d9cdef82c2c..1f5e34cf1c3 100644 --- a/packages/syft/src/syft/service/notifier/notifier.py +++ b/packages/syft/src/syft/service/notifier/notifier.py @@ -12,6 +12,7 @@ from typing import TypeVar # third party +from pydantic import BaseModel from result import Err from result import Ok from result import Result @@ -33,7 +34,7 @@ from .smtp_client import SMTPClient -class BaseNotifier: +class BaseNotifier(BaseModel): def send( self, target: SyftVerifyKey, notification: Notification ) -> SyftSuccess | SyftError: @@ -54,7 +55,7 @@ class UserNotificationActivity(SyftObject): @serializable(canonical_name="EmailNotifier", version=1) class EmailNotifier(BaseNotifier): smtp_client: SMTPClient - sender = "" + sender: str = "" def __init__( self, diff --git a/packages/syft/src/syft/service/notifier/smtp_client.py b/packages/syft/src/syft/service/notifier/smtp_client.py index 1f4df6531e5..f7041c9f722 100644 --- a/packages/syft/src/syft/service/notifier/smtp_client.py +++ b/packages/syft/src/syft/service/notifier/smtp_client.py @@ -4,13 +4,14 @@ import smtplib # third party +from pydantic import BaseModel from result import Err from result import Ok from result import Result -class SMTPClient: - SOCKET_TIMEOUT = 5 # seconds +class SMTPClient(BaseModel): + SOCKET_TIMEOUT: int = 5 # seconds def __init__( self,