Python
The Unsend Python package lets you interact with the Unsend API to send and manage emails as well as domains. This is a quick guide on using the package to send emails and retrieve email information.
Installation
To install the Unsend package, you can use pip:
Related Links
Github Repository: Github
PyPI package: PyPi
Usage
Below is an example of how to use the Unsend package to send an email and retrieve email information.
Initialize
Change the URL accordingly if you are using self self-hosted version of Unsend. The default URL will be https://app.unsend.dev.
Sending Emails
To send an email you will need to define the payload. After definition, you can use the .send_emails
method to send emails with the payload as a parameter.
Retrieve Emails using the id
The email will be retrieved using the ID you get after sending the mail.
The sample response of get_email
is shown below:
Retrieve domain information
Retrieves domain information Domains that are associated with this account will be displayed with their detailed information.
Sample response of the get_domain
method