44
55
66class _Recipient (BaseModel ):
7- """
8- Represents an email recipient with an email and an optional name.
9- Used for 'From', 'To', 'Cc', and 'ReplyTo' fields.
10- """
11-
127 Email : EmailStr
13- """Email address of the recipient."""
148 Name : str | None = None
15- """Optional name of the recipient."""
169
1710
1811class _Attachment (BaseModel ):
19- """
20- Represents a single file attachment.
21- """
22-
2312 Content : str
2413 """Base64-encoded string of the file content."""
2514 Filename : str
26- """The filename of the attachment."""
2715 ContentID : str | None = None
2816 """Optional Content-ID (cid) for inline attachments."""
2917 ContentType : str | None = None
@@ -32,32 +20,23 @@ class _Attachment(BaseModel):
3220
3321class _MailpitEmailSchema (BaseModel ):
3422 """
35- Defines the JSON schema for sending an email via Mailpit.
23+ JSON schema for sending an email via the Mailpit API .
3624 """
3725
3826 From : _Recipient
39- """The sender of the email."""
4027 To : list [_Recipient ] = []
41- """'To' recipients."""
4228
4329 Subject : str | None = None
44- """The email subject line."""
4530 HTML : str | None = None
46- """The HTML body of the message."""
4731 Text : str | None = None
4832 """The plain text body of the message."""
4933
5034 Cc : list [_Recipient ] | None = None
51- """'Cc' recipients."""
5235 Bcc : list [EmailStr ] | None = None
53- """'Bcc' recipients (email only)."""
5436 ReplyTo : list [_Recipient ] | None = None
55- """Optional 'Reply-To' recipients."""
5637
5738 Headers : dict [str , str ] | None = None
58- """Optional headers in key:value format."""
5939 Attachments : list [_Attachment ] | None = None
60- """A list of attachments."""
6140 Tags : list [str ] | None = None
6241 """Optional Mailpit tags for categorization."""
6342
0 commit comments