11from abc import ABC , abstractmethod
22
3+ from app .schemas .email_template import EmailContent , EmailTemplateType
4+
35
46class IEmailService (ABC ):
57 """
@@ -8,65 +10,20 @@ class IEmailService(ABC):
810 """
911
1012 @abstractmethod
11- def send_email (self , to : str , subject : str , body : str ) -> dict :
12- """
13- Sends an email with the given parameters.
14-
15- :param to: Recipient's email address
16- :type to: str
17- :param subject: Subject of the email
18- :type subject: str
19- :param body: HTML body content of the email
20- :type body: str
21- :return: Provider-specific metadata (like message ID, thread ID, label IDs)
22- :rtype: dict
23- :raises Exception: if email was not sent successfully
24- """
25- pass
26-
27- @abstractmethod
28- def send_welcome_email (self , recipient : str , user_name : str ) -> dict :
29- """
30- Sends a welcome email to the specified user.
31-
32- :param recipient: Email address of the user
33- :type recipient: str
34- :param user_name: Name of the user
35- :type user_name: str
36- :return: Provider-specific metadata for the sent email
37- :rtype: dict
38- :raises Exception: if email was not sent successfully
39- """
40- pass
41-
42- @abstractmethod
43- def send_password_reset_email (self , recipient : str , reset_link : str ) -> dict :
44- """
45- Sends a password reset email with the provided reset link.
46-
47- :param recipient: Email address of the user requesting the reset
48- :type recipient: str
49- :param reset_link: Password reset link
50- :type reset_link: str
51- :return: Provider-specific metadata for the sent email
52- :rtype: dict
53- :raises Exception: if email was not sent successfully
54- """
55- pass
56-
57- @abstractmethod
58- def send_notification_email (self , recipient : str , notification_text : str ) -> dict :
59- """
60- Sends a notification email to the user with the provided notification text.
61- Examples of use case include matches completed and ready to view, new messages,
62- meeting time scheduled, etc.
63-
64- :param recipient: Email address of the user
65- :type recipient: str
66- :param notification_text: The notification content
67- :type notification_text: str
68- :return: Provider-specific metadata for the sent email
69- :rtype: dict
70- :raises Exception: if email was not sent successfully
13+ def send_email (
14+ self , templateType : EmailTemplateType , content : EmailContent
15+ ) -> dict :
16+ """Send an email using the given template and content with a
17+ respective service provider.
18+
19+ Args:
20+ templateType (EmailTemplateType): Specifies the template
21+ to be used for the email
22+ content (EmailContent): Contains the recipient and data
23+ to be used in the email
24+
25+ Returns:
26+ dict: Provider-specific metadata if any
27+ (like message ID, thread ID, label IDs)
7128 """
7229 pass
0 commit comments