SDK Python untuk Mailtarget API
Project description
Mailtarget Python SDK
The Mailtarget Python SDK enable NodeJs developer to work with Mailtarget API efficiently.
Getting Started
Requirement
Python 3
Installation
To install the SDK to your project, you could get the package from PyPi via following command.
pip install mailtarget_sdk
or You can clone this repository and install it manual to your env
git clone https://gitlab.com/mailtarget/integrations/mailtarget-python-sdk
cd mailtarget-pyhton-sdk
pip install .
Authentication
You have to create a mailtarget account to get an API Key. To manage your API Key navigate to the page by clicking Configuration on the navbar in the mailtarget dashboard and then select API Key.
Setup Client
Basic Usage
from mailtarget_sdk import Layang, Message, Address
layang = Layang("your_api_key")
content = """
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Layang</title>
</head>
<body style="font-family: "Roboto", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif">
<h1>Hello World!!!</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<br/><br/>
<p style="color: #8A8A8A">powered by <a target="_blank" href="https://mailtarget.co" style="color: #8A8A8A">mailtarget</a></p>
</body>
</html>
"sender = Address(email = "no-reply@yoursendingdomain.test", name="Python")
recipients = [Address(email = "recipient@gmail.com", name="Wisnu")]
newMessage = Message(
subject= "Hello from Python SDK",
to=recipients,
from_address=sender,
body_html=content
)
response = layang.send(message=newMessage)
print(f'response {response}')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mailtarget_sdk-0.1.0.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for mailtarget_sdk-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffecfbee661c53674fbee949cc3627e9a9c8c93c1d529fdcec833f60cdbf9089 |
|
MD5 | 9d4ffc18898fbff9e238281e0f6356ab |
|
BLAKE2b-256 | 678043183f0f973c73131adc3ca1de8339659b90f3c30ff2e12a002a8a15387f |