Giter Site home page Giter Site logo

django-mailgun-incoming's Introduction

Django-Mailgun-Incoming

Info:A Django app for receival and storage of incoming emails from Mailgun
Author: Simon Hedberg (http://github.com/hedberg, http://twitter.com/SimonHedberg)

This README is derived from https://github.com/hmarr/django-ses/blob/master/README.rst

Overview

Django-Mailgun-Incoming stores email and attached files received through the Mailgun API. The goal of this package is to be easy to use and easy to customise when needed.

Getting started

Requirements

  • Django 1.3 or higher (class based views).

Installation

  • Install the package by cloning the repository to your Python path or install using pip:

    pip install git+https://github.com/hedberg/django-mailgun-incoming.git#egg=mailgun_incoming
    
  • Add "mailgun_incoming" to your INSTALLED_APPS setting:

    INSTALLED_APPS = [
        # ...
        "mailgun_incoming",
    ]
    
  • Include urls.

    url('^email/', include('mailgun_incoming.urls')),
    
  • Point your Mailgun forwarding to the URL used, i.e. /email/incoming/ using the above URL configuration.

  • Settings

    MAILGUN_ACCESS_KEY (optional) - This is used to verify the signature in posted data.

    MAILGUN_VERIFY_SIGNATURE (optional) - This defaults to True if MAILGUN_ACCESS_KEY is specified. Can be set to False for debugging etc.

    MAILGUN_UPLOAD_TO (optional) - This can be used to specify where attachments should be saved. This is passed to the file field. Defaults to 'attachments/'

Basic Usage

Using the default settings incoming emails are stored in the database and triggers the mailgun_incoming.signals.email_received signal for further processing.

These models are included in the package.

  • EmailBaseModel - an abstract base model
  • IncomingEmail - extends the base model adding a user field
  • Attachment - a basic model for storing incoming file attachments.

Processing of incoming data are done in the class based view Incoming.

Customisation

Customisation can be done by

  • adding processing logic triggered by the email_recieved signal (e.g. connecting a user object to the email)
  • extending the email model
  • passing parameters to the Incoming view
  • subclassing the Incoming view

django-mailgun-incoming's People

Contributors

hedberg avatar puterleat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

django-mailgun-incoming's Issues

500

Hello, I have installed this app in a django 1.8 and forwarded the mails from mailgun to the url. I also added the mailgun to the allowed hosts, but I always get a 500 error ImproperlyConfigured. What can be the reason?

email.Utils

In models.py, email.utils.parseaddr is never used.

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.