Code Monkey home page Code Monkey logo

flask-imail's Introduction

Flask-iMail

Flask integration for Mailgun mail service, from my own point of view.

Installation

I would advise you to create first a virtual environment and then install the library

$ git clone https://github.com/ipinak/Flask-iMail.git
$ cd Flask-iMail
$ python setup.py build install

If you have executed the above and you didn't face any error you will be ready to use the library.

Integration

from flask import Flask
import mailgun

app = Flask(__name__)
mailgun = mailgun.Mailgun()
app.config['MAILGUN_KEY'] = 'your-key'
app.config['DOMAIN'] = 'your-domain'
mailgun.init_app(app)

# Send an email
mailgun.send_email('[email protected]', '[email protected]',
message='test1', subject='test subject')

Tests

If you want to verify the ALL of the tests you need to open the file tests.py and set your MAILGUN_KEY and DOMAIN as well as the sender and receiver. Otherwise you will face an error stating: Exception: wrong result back...

If you do changes then run

$ python tests.py

TODO

  • Add function for events.
  • Add more functions for messages, e.g. receive, delete.
  • Add missing functions for domains.
  • Add functions for tags.
  • Add functions for suppressions.
  • Add functions for routes.
  • Add functions for mailing lists.
  • Add missing tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.