ZeptomailClient
Classes
GetMailAgentResponse
dataclass
GetProcessedEmailsResponse
dataclass
SendMailInput
dataclass
SendMailInput(mailagent_key: str, from_: FromAddress | Mapping[str, Any], to: List[EmailAddressItems | Mapping[str, Any]], subject: str, *, bounce_address: Optional[str] = None, cc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = None, bcc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = None, mailtype: Optional[str] = None, htmlbody: Optional[str] = None, reply_to: Optional[List[ReplyToAddress | Mapping[str, Any]]] = None, attachments: Optional[List[Dict[str, Any]]] = None)
Send mail
Attributes
bounce_address
class-attribute
instance-attribute
The email address to which bounced emails will be sent.
cc
class-attribute
instance-attribute
cc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)
Email addresses of cc'd recipients.
bcc
class-attribute
instance-attribute
bcc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)
Email addresses of bcc'd recipients.
mailtype
class-attribute
instance-attribute
Format of the mail to be sent
htmlbody
class-attribute
instance-attribute
This is the body content for your email.
SuccessMessage
dataclass
SuccessMessage(*, data: Optional[List[Dict[str, Any]]] = None, message: Optional[str] = None, request_id: Optional[str] = None)
Response for Send mail
Attributes
data
class-attribute
instance-attribute
data
message
class-attribute
instance-attribute
The status of the request made.
SendTemplateMailInput
dataclass
SendTemplateMailInput(mailagent_key: str, mail_template_key: str, from_: FromAddress | Mapping[str, Any], *, bounce_address: Optional[str] = None, to: Optional[List[EmailAddressItems | Mapping[str, Any]]] = None, cc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = None, bcc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = None, merge_key_detail: Optional[List[Dict[str, Any]]] = None, reply_to: Optional[List[ReplyToAddress | Mapping[str, Any]]] = None)
Send template mail
Attributes
bounce_address
class-attribute
instance-attribute
the email address to which bounced emails will be sent.
to
class-attribute
instance-attribute
to: Optional[List[EmailAddressItems | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)
Recipient email address.
cc
class-attribute
instance-attribute
cc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)
Email addresses of cc'd recipients.
bcc
class-attribute
instance-attribute
bcc: Optional[List[EmailAddressItems | Mapping[str, Any]]] = dataclass_field(default=None, kw_only=True)
Email addresses of bcc'd recipients.
merge_key_detail
class-attribute
instance-attribute
You can use merge tags to replace the placeholders with multiple values for different recipients.
ProcessedMailStatsResponse
dataclass
ProcessedMailStatsResponse(*, hb: Optional[Dict[str, Any]] = None, sb: Optional[Dict[str, Any]] = None, sent: Optional[Dict[str, Any]] = None)
Response for Processed emails analytics
Attributes
hb
class-attribute
instance-attribute
Emails that have hard bounced
sb
class-attribute
instance-attribute
sb
FromAddress
dataclass
EmailAddress
dataclass
ReplyToAddress
dataclass
Definition: ReplyToAddress
Attributes
address
class-attribute
instance-attribute
A valid email address containing a domain that is verified in your Mail Agent.
EmailAddressItems
dataclass
Definition: EmailAddressItems
ZeptomailClient
ZeptomailClient(connection_runtime_url: str, credential: AsyncTokenCredential | AzureKeyCredential, *, max_retry_attempts: int = 3, timeout: float = 30.0, use_exponential_backoff: bool = True, initial_retry_delay_seconds: float = 0.5, maximum_retry_delay_seconds: float = 120.0, retry_jitter_factor: float = 0.1, retry_unsafe_http_methods: bool = False, transport: Optional[AsyncHttpTransport] = None, **kwargs: Any)
Bases: ConnectorClientBase
Typed client for zeptomail connector.
Initialize a ZeptomailClient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection_runtime_url
|
str
|
The connection runtime URL from Azure Portal. |
required |
credential
|
AsyncTokenCredential | AzureKeyCredential
|
Caller-owned Azure Core credential. |
required |
max_retry_attempts
|
int
|
The maximum number of request attempts. |
3
|
timeout
|
float
|
The network timeout in seconds for each request. The value configures Azure Core retry and transport deadlines. Nonpositive values disable SDK and transport deadlines. |
30.0
|
use_exponential_backoff
|
bool
|
Whether retries use exponential backoff. |
True
|
initial_retry_delay_seconds
|
float
|
The initial retry delay in seconds. |
0.5
|
maximum_retry_delay_seconds
|
float
|
The maximum retry delay in seconds. |
120.0
|
retry_jitter_factor
|
float
|
The jitter fraction applied to retry delays. |
0.1
|
retry_unsafe_http_methods
|
bool
|
Whether unsafe HTTP methods may be retried. |
False
|
transport
|
Optional[AsyncHttpTransport]
|
Optional Azure Core async HTTP transport closed by the client through its asynchronous lifecycle. |
None
|
**kwargs
|
Any
|
Optional Azure Core pipeline policy settings. |
{}
|
Methods:
get_mail_agent
async
get_mail_agent(*, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Get all Mail Agent
This endpoint fetches details of all the Mail Agents in the account. It returns data including Mail Agent name, Mail Agent key, Created time, Status. \n\nData Fields Explained:\n- mailagent_name: Name of the Mail Agent.\n- mailagent_key: Mail Agent Key.\n- mailagent_alias: Mail Agent Alias.\n- created_time: Time at which the Mail Agent was created.\n- status: Status of the Mail Agent.\n\nExample 1: To retrieve details of all Mail Agents in the ZeptoMail account. Sample prompt 1: Get me details of all the Mail Agents in the account.
Swagger operation ID: GetMailAgent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
get_processed_emails
async
get_processed_emails(mailagent_key: str, *, subject: Optional[str] = None, from_: Optional[str] = None, to: Optional[str] = None, date_from: Optional[str] = None, date_to: Optional[str] = None, request_id: Optional[str] = None, is_hb: Optional[bool] = None, is_sb: Optional[bool] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Get processed email details
This endpoint fetches detailed information about emails processed by Mail Agent identified by its unique ID. It returns data including the Subject, From Address, Sent time and Request ID for emails sent for the time range. The mailagent_key parameter should match the Mail Agent key of the Mail Agent as listed in our system.
Swagger operation ID: Get_Processed_Emails.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mailagent_key
|
str
|
Choose Mail Agent or enter the Mail Agent key. |
required |
subject
|
Optional[str]
|
Enter subject of the email. |
None
|
from_
|
Optional[str]
|
Enter sender address of the email. |
None
|
to
|
Optional[str]
|
Enter recipient address of the email. |
None
|
date_from
|
Optional[str]
|
Enter from date for search in the format yyyy-MM-ddTHH:mm:sszzz. |
None
|
date_to
|
Optional[str]
|
Enter to date for search in the format yyyy-MM-ddTHH:mm:sszzz. |
None
|
request_id
|
Optional[str]
|
Enter Request ID of the email. |
None
|
is_hb
|
Optional[bool]
|
Include hardbounces in results. |
None
|
is_sb
|
Optional[bool]
|
Include softbounces in results. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
send_mail
async
send_mail(input: SendMailInput | Mapping[str, Any], *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Send mail
To send an email to the desired recipient.
Swagger operation ID: SendMail.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
SendMailInput | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
send_template_mail
async
send_template_mail(input: SendTemplateMailInput | Mapping[str, Any], *, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Send template mail
Sending a single email using Templates.
Swagger operation ID: SendTemplateMail.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
SendTemplateMailInput | Mapping[str, Any]
|
The request body. Mapping keys use serialized Swagger wire names. |
required |
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |
processed_mail_stats
async
processed_mail_stats(mailagent: str, *, from_time: Optional[str] = None, to_time: Optional[str] = None, timeout: Optional[float] = None, headers: Optional[Mapping[str, str]] = None, client_request_id: Optional[str] = None, response_hook: Optional[ConnectorResponseHook] = None) -> dict[str, Any] | None
Processed emails analytics
This endpoint fetches emails analytics for emails sent by Mail Agent identified by its Mail Agent name. It returns data including total count of Hardbounce, Softbounce and Sent statistics over a period of time and each day . The mailagent parameter should match the Mail Agent name as listed in our system.
Swagger operation ID: Processed_Mail_Stats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mailagent
|
str
|
Choose or enter Mail agent name. |
required |
from_time
|
Optional[str]
|
Enter statics from date in the format yyyy-MM-ddTHH:mm:sszzz. |
None
|
to_time
|
Optional[str]
|
Enter statics to date in the format yyyy-MM-ddTHH:mm:sszzz. |
None
|
timeout
|
Optional[float]
|
The request timeout in seconds. |
None
|
headers
|
Optional[Mapping[str, str]]
|
Additional HTTP request headers. |
None
|
client_request_id
|
Optional[str]
|
A caller-provided request identifier. |
None
|
response_hook
|
Optional[ConnectorResponseHook]
|
A callback invoked with the connector response. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any] | None
|
dict[str, Any] | None: The connector operation result. |
Raises:
| Type | Description |
|---|---|
ConnectorException
|
If the connector request fails. |