|
4 | 4 |
|
5 | 5 |
|
6 | 6 | class _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 | | - |
12 | 7 | Email: EmailStr |
13 | | - """Email address of the recipient.""" |
14 | 8 | Name: str | None = None |
15 | | - """Optional name of the recipient.""" |
16 | 9 |
|
17 | 10 |
|
18 | 11 | class _Attachment(BaseModel): |
19 | | - """ |
20 | | - Represents a single file attachment. |
21 | | - """ |
22 | | - |
23 | 12 | Content: str |
24 | 13 | """Base64-encoded string of the file content.""" |
25 | 14 | Filename: str |
26 | | - """The filename of the attachment.""" |
27 | 15 | ContentID: str | None = None |
28 | 16 | """Optional Content-ID (cid) for inline attachments.""" |
29 | 17 | ContentType: str | None = None |
30 | 18 | """Optional content type. If empty, it's auto-detected.""" |
31 | 19 |
|
32 | 20 |
|
33 | 21 | class _MailpitEmailSchema(BaseModel): |
34 | | - """ |
35 | | - Defines the JSON schema for sending an email via Mailpit. |
36 | | - """ |
37 | | - |
38 | 22 | From: _Recipient |
39 | | - """The sender of the email.""" |
40 | 23 | To: list[_Recipient] = [] |
41 | | - """'To' recipients.""" |
42 | 24 |
|
43 | 25 | Subject: str | None = None |
44 | | - """The email subject line.""" |
45 | 26 | HTML: str | None = None |
46 | | - """The HTML body of the message.""" |
47 | 27 | Text: str | None = None |
48 | | - """The plain text body of the message.""" |
49 | 28 |
|
50 | 29 | Cc: list[_Recipient] | None = None |
51 | | - """'Cc' recipients.""" |
52 | 30 | Bcc: list[EmailStr] | None = None |
53 | | - """'Bcc' recipients (email only).""" |
54 | 31 | ReplyTo: list[_Recipient] | None = None |
55 | | - """Optional 'Reply-To' recipients.""" |
56 | 32 |
|
57 | 33 | Headers: dict[str, str] | None = None |
58 | | - """Optional headers in key:value format.""" |
59 | 34 | Attachments: list[_Attachment] | None = None |
60 | | - """A list of attachments.""" |
61 | 35 | Tags: list[str] | None = None |
62 | 36 | """Optional Mailpit tags for categorization.""" |
63 | 37 |
|
|
0 commit comments