|
1 | 1 | import sys
|
2 |
| -import warnings |
3 | 2 | from urllib.parse import quote
|
4 | 3 |
|
5 | 4 | if sys.version_info < (3, 11):
|
6 | 5 | from typing_extensions import Any, Dict, List, Literal, NotRequired, TypedDict
|
7 | 6 | else:
|
8 | 7 | from typing import Any, Dict, List, Literal, NotRequired, TypedDict
|
9 | 8 |
|
10 |
| -from ..exceptions import AnymailRequestsAPIError, AnymailWarning |
| 9 | +from ..exceptions import AnymailRequestsAPIError |
11 | 10 | from ..message import AnymailMessage, AnymailRecipientStatus
|
12 | 11 | from ..utils import Attachment, EmailAddress, get_anymail_setting, update_deep
|
13 | 12 | from .base_requests import AnymailRequestsBackend, RequestsPayload
|
@@ -139,6 +138,12 @@ def add_attachment(self, attachment: Attachment):
|
139 | 138 | att["content_id"] = attachment.cid
|
140 | 139 | self.data.setdefault("attachments", []).append(att)
|
141 | 140 |
|
| 141 | + def set_tags(self, tags: List[str]): |
| 142 | + if len(tags) > 1: |
| 143 | + self.unsupported_feature("multiple tags") |
| 144 | + if len(tags) > 0: |
| 145 | + self.data["category"] = tags[0] |
| 146 | + |
142 | 147 | def set_metadata(self, metadata):
|
143 | 148 | self.data.setdefault("custom_variables", {}).update(
|
144 | 149 | {str(k): str(v) for k, v in metadata.items()}
|
|
0 commit comments