Skip to main content

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mailtarget_sdk-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file mailtarget_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: mailtarget_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for mailtarget_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a70570c96ab6d84dccd38cb5359c1c1c8f19b565584942b23eefb06247ddac17
MD5 097961b1a8f5dc07e18d12d04e33cc37
BLAKE2b-256 526ffa273989b0e4cbddcfbf06e07379eefc380a1e3bc76c6b4722aea368d240

See more details on using hashes here.

File details

Details for the file mailtarget_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mailtarget_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for mailtarget_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffecfbee661c53674fbee949cc3627e9a9c8c93c1d529fdcec833f60cdbf9089
MD5 9d4ffc18898fbff9e238281e0f6356ab
BLAKE2b-256 678043183f0f973c73131adc3ca1de8339659b90f3c30ff2e12a002a8a15387f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page