Skip to content

YonomaHQ/yonoma-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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",
        firstName: string, //optional
        lastName: string, //optional
        phone: string, //optional
        gender: string, //optional
        address: string, //optional
        city: string, //optional
        state: string, //optional
        country: string, //optional
        zipcode: string //optional
    }
)
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.

About

The official Python client library for the Yonoma Email Marketing API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages