Skip to main content

A Python client for the Yonoma API

Project description

Yonoma Email Marketing Python SDK

The official Python client library for the Yonoma Email Marketing API.


Installation**

Install via pip:

pip install yonoma

or manually install from GitHub:

pip install git+https://github.com/YonomaHQ/yonoma-python

Quick Start

Note: This SDK requires Python 3.7 or above.

from yonoma import Yonoma

# Initialize the client
yonoma = Yonoma(api_key="YOUR-API-KEY")

Send your email

response = yonoma.email.send({
    'from_email': 'updates@yonoma.io',
     'to_email': 'email@yourdomain.com',
     'subject':"Welcome to Yonoma - You're In!",
     'mail_template': "We're excited to welcome you to Yonoma! Your successful signup marks the beginning of what we hope will be an exceptional journey."
    })
print(response)

Features

Lists

Create a new list

response = yonoma.lists.create('list_name':'New group')
print(response)

Get a list of Lists

response = yonoma.lists.list()
print(response)

Retrieve a specific list

response = yonoma.lists.retrieve("list_id")
print(response)

Update a list

response = yonoma.lists.update('list_id', {'list_name': 'Upadated list name'})
print(response)

Delete a list

response = yonoma.lists.delete('list_id')
print(response)

Tags

Create a new tag

response = yonoma.tags.create({'tag_name': 'New tag'})
print(response)

Get a list of tags

response = yonoma.tags.list()
print(response)

Retrieve a specific tag

response = yonoma.tags.retrieve('tag_id')
print(response)

Update a tag

response = yonoma.tags.update('tag_id', {'tag_name': 'Updated Tag Name'})
print(response)

Delete a tag

response = Tags.delete('tag_id')
print(response)

Contacts

Create a new contact

response = yonoma.contacts.create("list_id",
    {
        email: "email@example.com",
        status: "Subscribed" | "Unsubscribed",
        data: {
            firstName: string,
            lastName: string,
            phone: string,
            gender: string,
            address: string,
            city: string,
            state: string,
            country: string,
            zipcode: string,
        }
    }
)
print(response)

Update a contact

response = yonoma.contacts.update('list_id','contact_id',{
    'status': "Subscribed" | "Unsubscribed" 
}
)
print(response)

Add a tag to a contact

response = yonoma.contacts.addtag('contact_id', {
    'tag_id': 'Tag id'
})
print(response)

Remove a tag from a contact

response = yonoma.contacts.removetag('contact_id', {
    'tag_id': 'Tag id'
})
print(response)

Useful Links


License

This package is licensed under the MIT License.


This is the official Python SDK for Yonoma Email Marketing, providing seamless API integrations.

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

yonoma-1.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

yonoma-1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file yonoma-1.1.tar.gz.

File metadata

  • Download URL: yonoma-1.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for yonoma-1.1.tar.gz
Algorithm Hash digest
SHA256 2cf8158c9e0af048eb6cdd781e924b9290dae8d0d30b527a608480dc45bc1c8a
MD5 21040054aceed8ec65cd1304bc0482d5
BLAKE2b-256 43deda4fe16ba0b362159669e128b8e0ce8e415fe1113ecf49f1dcca1dbed3b4

See more details on using hashes here.

File details

Details for the file yonoma-1.1-py3-none-any.whl.

File metadata

  • Download URL: yonoma-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for yonoma-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 44deed1842d8b450e3afc847b3a33757f8745c17a5dad86994657e669945f396
MD5 48cbe0c75be7bd044a8a7e5351f3b4db
BLAKE2b-256 2795636be975a531e0e896564cf69ec759de0cd7e63461d97747128bc825a7c9

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