This is a Python SDK for Unimail. Quickly integrate into your project
Project description
unimal-py-sdk
This is a Python SDK for Unimail. Quickly integrate into your project
simple usage
- init a unimail client
you need a authorization key.
main.py
from unimail-py-sdk import Client, Result
# please input your key here
key: str = ""
client: Client = Client(key)
client.check_connect()
- send email
example
receiver: aaa@gmail.com
email subject: email subject
email content: this is a email content
result: Result := client.send_email("aaa@gmail.com", "email subject", "this is a email content")
if result.is_success:
print("send email success")
else:
print(f"send email fail, error: {result.msg}")
- batch send email
example
receivers: aaa@gmail.com,bbb@gmail.com
email subject: email subject
email content: this is a email content
result: Result := client.batch_send_email("aaa@gmail.com", "email subject", "this is a email content")
if result.is_success:
print("send email success")
else:
print(f"send email fail, error: {result.msg}")
api docs
- Client(key: str, host: str, data: str, obj: json): Client
init a client by key
- client.set_language(language :str) -> bool
set language for the client,default is zh
- client.check_connect() -> bool
check the host and key is ok
- client.send_email(receiver :str, subject :str, content :str) -> Result
send email to receiver. if you have many receiver, you can concat the receiver by ";" or use BatchSendEmail
- client.batch_send_email(receivers :list, subject :str, content :str) -> Result
like SendEmail, but receivers is a slice
support language
chinese is the default language for the sdk.
- english (en)
- simple chinese (zh)
- vietnamese (vi)
- idonesian (id)
- thai (th)
- gujarati (gu)
if you want to support other language, please open a issue.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unimail_py_sdk-0.0.2.tar.gz.
File metadata
- Download URL: unimail_py_sdk-0.0.2.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f0e62465338acda5b17c771f539f8162875e78426ce60e71570bbd72f735b7a
|
|
| MD5 |
e501f34534321dc004b9f3251ed2dc4e
|
|
| BLAKE2b-256 |
5c7385e95c0c7e6d1521114d29194fc77d29c6d2366014d829f3bcabe2f58183
|
File details
Details for the file unimail_py_sdk-0.0.2-py3-none-any.whl.
File metadata
- Download URL: unimail_py_sdk-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.12.7 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09ae320450ab32f7867df4f1b11ad772fdc8ebc925ed9b7b8a8bb67a3488cebd
|
|
| MD5 |
bc91ad24c3acaec3c04092c79465a236
|
|
| BLAKE2b-256 |
8b138fde7dc4530e02f7212e6d4bebef747810c27bc00e93a900c99658c0de98
|