1111from resend .pagination_helper import PaginationHelper
1212
1313
14+ class EmailTemplate (TypedDict ):
15+ """
16+ EmailTemplate is the class that wraps template configuration for email sending.
17+
18+ Attributes:
19+ id (str): The template ID.
20+ variables (NotRequired[Dict[str, Union[str, int]]]): Optional variables to be used in the template.
21+ """
22+
23+ id : str
24+ """
25+ The template ID.
26+ """
27+ variables : NotRequired [Dict [str , Union [str , int ]]]
28+ """
29+ Optional variables to be used in the template.
30+ """
31+
32+
1433class _UpdateParams (TypedDict ):
1534 id : str
1635 """
@@ -51,7 +70,7 @@ class _CancelScheduledEmailResponse(TypedDict):
5170_SendParamsFrom = TypedDict (
5271 "_SendParamsFrom" ,
5372 {
54- "from" : str ,
73+ "from" : NotRequired [ str ] ,
5574 },
5675)
5776
@@ -61,7 +80,7 @@ class _SendParamsDefault(_SendParamsFrom):
6180 """
6281 List of email addresses to send the email to.
6382 """
64- subject : str
83+ subject : NotRequired [ str ]
6584 """
6685 The subject of the email.
6786 """
@@ -102,6 +121,10 @@ class _SendParamsDefault(_SendParamsFrom):
102121 Schedule email to be sent later.
103122 The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
104123 """
124+ template : NotRequired [EmailTemplate ]
125+ """
126+ Template configuration for sending emails using predefined templates.
127+ """
105128
106129
107130class Emails :
@@ -140,9 +163,9 @@ class SendParams(_SendParamsDefault):
140163 """SendParams is the class that wraps the parameters for the send method.
141164
142165 Attributes:
143- from (str): The email address to send the email from.
166+ from (NotRequired[ str] ): The email address to send the email from.
144167 to (Union[str, List[str]]): List of email addresses to send the email to.
145- subject (str): The subject of the email.
168+ subject (NotRequired[ str] ): The subject of the email.
146169 bcc (NotRequired[Union[List[str], str]]): Bcc
147170 cc (NotRequired[Union[List[str], str]]): Cc
148171 reply_to (NotRequired[Union[List[str], str]]): Reply to
@@ -151,6 +174,7 @@ class SendParams(_SendParamsDefault):
151174 headers (NotRequired[Dict[str, str]]): Custom headers to be added to the email.
152175 attachments (NotRequired[List[Union[Attachment, RemoteAttachment]]]): List of attachments to be added to the email.
153176 tags (NotRequired[List[Tag]]): List of tags to be added to the email.
177+ template (NotRequired[EmailTemplate]): Template configuration for sending emails using predefined templates.
154178 """
155179
156180 class SendOptions (TypedDict ):
0 commit comments