Skip to main content

SendGrid for Humans

Project description

sendgrify

SendGrid for Humans

Sendgrify is a Python package serving as a wrapper over the email delivery service SendGrid.

This is an attempt to simplify the use of sendgrid-python: the Official Twilio SendGrid Led, Community Driven Python API Library.

Installation

$ pip install sendgrify

Usage

Initialization

Prior to use the package you should get a SendGrid API key.

from sendgrify.core import SendGrid

sg = Sendgrid(api_key='your_sendgrid_api_key',
              from_addr='from@example.com',
              from_name='Sendgrify')

Sending simple email

sg.send(to='to@example.com',
        subject='Sendgrify is nice',
        msg='Hi there!\nI am using this cool new Python package')

Sending to several recipients

sg.send(to=['one@example.com', 'two@example.com'],
        subject='Sendgrify is nice',
        msg='Hi there!\nI am using this cool new Python package')

Sending with carbon copy

sg.send(to='to@example.com',
        cc=['one@example.com', 'two@example.com'],
        subject='Sendgrify is nice',
        msg='Hi there!\nI am using this cool new Python package')

Sending with blind carbon copy

sg.send(to='to@example.com',
        bcc=['one@example.com', 'two@example.com'],
        subject='Sendgrify is nice',
        msg='Hi there!\nI am using this cool new Python package')

Sending with attachments

sg.send(to='to@example.com',
        subject='Sendgrify is nice',
        msg='Hi there!\nI am using this cool new Python package',
        attachments=['README.md', 'system.zip'])

Set the proper path to your attachments.

Sending with html contents

sg.send(to='to@example.com',
        subject='Sendgrify is nice',
        msg='Hi <b>there</b>!<br><br>I am using this <a href="https://pypi.org/">cool new Python package</a>',
        html=True)

Changelog

1.0.1 01/03/2021
  • Fix description and useful tags for PyPi.
1.0.0 01/03/2021
  • Add initial code.
  • Add documentation.
  • Add tests.
  • Add makefile.

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

sendgrify-1.0.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

sendgrify-1.0.1-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

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