Skip to main content

mailjet is a django app to implement the mailjet REST API

Project description

Introduction

mailjet is a library to access the Mailjet REST API.

Install

To install simply execute python setup.py install.

The settings can be configured from a Django settings file through MAILJET_API_KEY and MAILJET_SECRET_KEY. Or through environment variables the same name.

i.e.

export MAILJET_API_KEY=something
export MAILJET_SECRET_KEY=something_else

Usage

To fetch data:

>>> import mailjet
>>> print mailjet.Api().user.infos()
{
    u'status': u'OK',
    u'infos': {
        u'username': u'user@domain.com',
        u'firstname': u'firstname',
        u'locale': u'en_US',
        u'lastname': u'lastname',
        u'company_name': u'company_name',
        u'contact_phone': None,
    },
}

To put data:

>>> import mailjet
>>> api = mailjet.Api()
>>> list_ = api.lists.create(label='Test', name='test')
>>> print list_
{u'status': u'OK', u'list_id': ...}
>>> print api.user.addcontact(
    contact='user@domain.com',
    id=list_['list_id'],
    method='POST',
)

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

mailjet-1.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: mailjet-1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mailjet-1.1.tar.gz
Algorithm Hash digest
SHA256 5939ca128085b0536457343b583d37efa319e9a5ce8365c41bd62dcf7684f166
MD5 3f5417b1137bf6954c74dfbe463b6321
BLAKE2b-256 ba92124bedea34af50021b616c0af597808b03fe0463ee32818099ce25f1f460

See more details on using hashes here.

Supported by

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