|
| 1 | +<a id="camel.toolkits.resend_toolkit"></a> |
| 2 | + |
| 3 | +<a id="camel.toolkits.resend_toolkit.ResendToolkit"></a> |
| 4 | + |
| 5 | +## ResendToolkit |
| 6 | + |
| 7 | +```python |
| 8 | +class ResendToolkit(BaseToolkit): |
| 9 | +``` |
| 10 | + |
| 11 | +A toolkit for sending emails using the Resend API. |
| 12 | + |
| 13 | +This toolkit provides functionality to send emails using Resend's |
| 14 | +Python SDK.It supports sending both HTML and plain text emails, |
| 15 | +with options for multiple recipients, CC, BCC, reply-to |
| 16 | +addresses, and custom headers. |
| 17 | + |
| 18 | +<a id="camel.toolkits.resend_toolkit.ResendToolkit.send_email"></a> |
| 19 | + |
| 20 | +### send_email |
| 21 | + |
| 22 | +```python |
| 23 | +def send_email( |
| 24 | + self, |
| 25 | + to: List[str], |
| 26 | + subject: str, |
| 27 | + from_email: str, |
| 28 | + html: Optional[str] = None, |
| 29 | + text: Optional[str] = None, |
| 30 | + cc: Optional[List[str]] = None, |
| 31 | + bcc: Optional[List[str]] = None, |
| 32 | + reply_to: Optional[str] = None, |
| 33 | + tags: Optional[List[Dict[str, str]]] = None, |
| 34 | + headers: Optional[Dict[str, str]] = None |
| 35 | +): |
| 36 | +``` |
| 37 | + |
| 38 | +Send an email using the Resend API. |
| 39 | + |
| 40 | +**Parameters:** |
| 41 | + |
| 42 | +- **to** (List[str]): List of recipient email addresses. |
| 43 | +- **subject** (str): The email subject line. |
| 44 | +- **from_email** (str): The sender email address. Must be from a verified domain. |
| 45 | +- **html** (Optional[str]): The HTML content of the email. Either html or text must be provided. (default: :obj:`None`) |
| 46 | +- **text** (Optional[str]): The plain text content of the email. Either html or text must be provided. (default: :obj:`None`) |
| 47 | +- **cc** (Optional[List[str]]): List of CC recipient email addresses. (default: :obj:`None`) |
| 48 | +- **bcc** (Optional[List[str]]): List of BCC recipient email addresses. (default: :obj:`None`) |
| 49 | +- **reply_to** (Optional[str]): The reply-to email address. (default: :obj:`None`) |
| 50 | +- **tags** (Optional[List[Dict[str, str]]]): List of tags to attach to the email. Each tag should be a dict with 'name' and 'value' keys. (default: :obj:`None`) |
| 51 | +- **headers** (Optional[Dict[str, str]]): Custom headers to include in the email.(default: :obj:`None`) |
| 52 | + |
| 53 | +**Returns:** |
| 54 | + |
| 55 | + str: A success message with the email ID if sent successfully, |
| 56 | +or an error message if the send failed. |
| 57 | + |
| 58 | +<a id="camel.toolkits.resend_toolkit.ResendToolkit.get_tools"></a> |
| 59 | + |
| 60 | +### get_tools |
| 61 | + |
| 62 | +```python |
| 63 | +def get_tools(self): |
| 64 | +``` |
| 65 | + |
| 66 | +**Returns:** |
| 67 | + |
| 68 | + List[FunctionTool]: A list of FunctionTool objects |
| 69 | +representing the functions in the toolkit. |
0 commit comments