Skip to main content

Python Wrapper With Fluent API for Mailgun v3

Project description

MailGun V3

This package provides fluent API for MailGun API.

build status Documentation Status Code Climate Issue Count

Installation

pip install mailgunv3

Usage

domain = 'example.com'

mg = MailGunV3(domain,
               'key-asdfghjkl',
               'pubkey-asdfghjkl')

res1 = (mg.
        mailinglist('mlA-{}@{}'.format(random.randint(0, 10), domain)).
        create('Test Mailing List').
        delete())
print(repr(res1))

res2 = (mg.
        mailinglist('mlB-{}@{}'.format(random.randint(0, 10), domain)).
        create('Test Mailing List').
        update(
            name='New Name',
            description='New Description').
        get())
print(repr(res2))

res3 = (mg.
        mailinglist('newsletter-dev@' + domain).
        members())
print(repr(res3))

res4 = (mg.
        mailinglist('newsletter-dev@' + domain).
        member('a01-{}@{}'.format(random.randint(0, 1000), domain)).
        create(
            name='Foo Bar',
            params={'a': 1, 'b': 2}).
        get())
print(repr(res4))

res5 = (mg.
        mailinglist('newsletter-dev@' + domain).
        member('a01-{}@{}'.format(random.randint(0, 1000), domain)).
        update(
            name='Foo Bar - EDIT',
            params={'a': 1, 'b': 2}).
        get())
print(repr(res5))

res6 = (mg.
        mailinglist('newsletter-dev@' + domain).
        members())
print(repr(res6))

res7 = (mg.
        mailinglist('newsletter-dev@' + domain).
        member('a01@' + domain).
        delete())
print(repr(res7))

Changelog

0.2

  • Playing with documentation

0.1

  • Initial commit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for MailGun-V3, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size MailGun-V3-0.3.2.tar.gz (5.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page