Skip to main content

Official Python Library by Pepipost for sending email using Web API v5

Project description

pepipostlogo

MIT licensed Open Source Helpers Twitter Follow

Python SDK Client library :snake: for Pepipost

This SDK contain methods for easily interacting with the Pepipost Email Sending API to send emails within few seconds.

We are trying to make our libraries a Community Driven. To help us building right things in proper order we would request you to help us by sharing comments, creating new issues or pull requests. We welcome any sort of contribution to this library.

The latest 5.0 version of this library provides is fully compatible with the latest Pepipost v5 API. For any update of this library check Releases

Table of Content

Installation

Prerequisites

  • Python (2 >=2.7.9 or 3 >= 3.4)

  • Python IDE (we are using Pycharm )

  • Python packages

    • nose
    • jsonpickle
    • requests
    • cachecontrol
    • python-dateutil
  • Installation of PIP can be done from here.

  • We recommend using PIP Dependency manager in order to install all the dependencies which we had mentioned in requirements.txt files that comes in SDK.

Install Package

Install directly from GitHub

You can install the library directly from GitHub also using the below command:

git clone https://github.com/pepipost/pepipost-sdk-python.git pepipost_python

Note: If you are installing directly from GitHub, then you need to install the dependecies separately which are mentioned in our requirements.txt file.

For IDE based installation

Refer here to install and use this SDK in a IDE environment.

Sample Example

from pepipost.pepipost_client import PepipostClient
from pepipost.configuration import Configuration
from pepipost.models.send import Send
from pepipost.models.mfrom import From
from pepipost.models.content import Content
from pepipost.models.type_enum import TypeEnum
from pepipost.models.attachments import Attachments
from pepipost.models.personalizations import Personalizations
from pepipost.models.email_struct import EmailStruct
from pepipost.models.settings import Settings
from pepipost.exceptions.api_exception import APIException
import jsonpickle

api_key = 'your api_key here'

client = PepipostClient(api_key)

mail_send_controller = client.mail_send
body = Send()
body.reply_to = 'you-reply-to-id-address@mydomain.name'
body.mfrom = From()
body.mfrom.email = 'hello@your-register-domain-with-pepipost'
body.mfrom.name = 'Example Pepi'
body.subject = 'Emailing with Pepipost is easy'
body.content = []

body.content.append(Content())
body.content[0].mtype = TypeEnum.HTML
body.content[0].value = '<html><body>Hey,<br><br>Do you know integration is even simpler in Pepipost, <br>with Python <br> Happy Mailing ! <br><br>Pepipost </body></html>'

body.personalizations = []

body.personalizations.append(Personalizations())
body.personalizations[0].to = []

body.personalizations[0].to.append(EmailStruct())
body.personalizations[0].to[0].name = 'random'
body.personalizations[0].to[0].email = 'random@mydomain.name'

body.tags = ['Campaign']

try:
    result = mail_send_controller.create_generatethemailsendrequest(body)
    print(result)
except APIException as e: 
    print(e)

Announcements

v5.0 has been released! Please see the release notes for details.

All updates to this library are documented in our releases. For any queries, feel free to reach out us at dx@pepipost.com

Roadmap

If you are interested in the future direction of this project, please take a look at our open issues and pull requests. We would love to hear your feedback.

About

pepipost-sdk-python library is guided and supported by the Pepipost Developer Experience Team . This pepipost-sdk-python library is maintained and funded by Pepipost Ltd. The names and logos for pepipost-php-sdk are trademarks of Pepipost Ltd.

License

This code library was semi-automatically generated by APIMATIC v2.0 and licensed under The MIT License (MIT).

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

pepipost-5.0.0.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

pepipost-5.0.0-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file pepipost-5.0.0.tar.gz.

File metadata

  • Download URL: pepipost-5.0.0.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for pepipost-5.0.0.tar.gz
Algorithm Hash digest
SHA256 779ad9fccf99eeee0af7ff19bdd7f0e8cfc92d1b7af36a8f48a6a850983b5c62
MD5 1a2d779a6560a424e2d21b7456423059
BLAKE2b-256 c7797f139903770ab1a7f543a506faba517328e29d5ec3cbda5c8ab335764c3d

See more details on using hashes here.

File details

Details for the file pepipost-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: pepipost-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 54.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.8

File hashes

Hashes for pepipost-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49e5cf354b95e57a9ffd4e8c0983b2f08d05b63047d60c615080f07e8a77f572
MD5 c528846ae4d0b0bf235bfe046088d606
BLAKE2b-256 2dda1a620c2106577092db156a7c51ef29ee801af717ae43a6c35531f46b751d

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