django-mail-queue


Namedjango-mail-queue JSON
Version 3.2.6 PyPI version JSON
download
home_pagehttp://github.com/Privex/django-mail-queue
SummarySimple Mail Queuing for Django
upload_time2024-10-26 14:32:06
maintainerNone
docs_urlNone
authorPrivex Inc. (2019+) / Derek Stegelman (2011-2018)
requires_pythonNone
licenseMIT
keywords django-mail-queue
VCS
bugtrack_url
requirements pytest pytest-django pytest-flakes pytest-pep8 factory_boy
Travis-CI
coveralls test coverage No coveralls.
            [![Build Status](https://travis-ci.org/Privex/django-mail-queue.png?branch=master)](https://travis-ci.org/Privex/django-mail-queue)
[![PyPi Version](https://img.shields.io/pypi/v/django-mail-queue.svg)](https://pypi.org/project/django-mail-queue/)
![License Button](https://img.shields.io/pypi/l/django-mail-queue) ![PyPI - Downloads](https://img.shields.io/pypi/dm/django-mail-queue)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-mail-queue) 
![GitHub last commit](https://img.shields.io/github/last-commit/Privex/django-mail-queue)

Django Mail Queue
=================

This is a fork of http://github.com/dstegelman/django-mail-queue maintained by [Privex Inc.](https://www.privex.io/)

Derek passed on ownership of the original `django-mail-queue` PyPi package to Privex on 17 Sep 2019

Privex publishes the fork under the original PyPi package `django-mail-queue` (since v3.2.0).

This fork is considered to be actively maintained by Privex for both bug fixes and feature additions since
December 2018. 

If our fork has helped you, consider 
[grabbing a VPS or Dedicated Server from Privex](https://www.privex.io/) - prices start at as little 
as US$0.99/mo (yes that's 99 cents a month, and we take cryptocurrency!)

Mail Queue provides an easy and simple way to send email.  Each email is saved and queued up either in
real time or with Celery.  As always, feedback, bugs, and suggestions are welcome.



Install
========

`django-mail-queue` maintains high compatibility, from as old as Django 1.8 on Python 2.7, up to Django 2.2 on 
Python 3.7

To check the compatibility, see [Travis CI](https://travis-ci.org/Privex/django-mail-queue), which runs the unit
tests on a variety of Python and Django versions.

### Download and install from PyPi using pip (recommended)

```sh
pip3 install django-mail-queue
```

### (Alternative) Manual install from Git

**Option 1 - Use pip to install straight from Github**

```sh
pip3 install git+https://github.com/Privex/django-mail-queue
```

**Option 2 - Clone and install manually**

```bash
# Clone the repository from Github
git clone https://github.com/Privex/django-mail-queue
cd django-mail-queue

# RECOMMENDED MANUAL INSTALL METHOD
# Use pip to install the source code
pip3 install .

# ALTERNATIVE MANUAL INSTALL METHOD
# If you don't have pip, or have issues with installing using it, then you can use setuptools instead.
python3 setup.py install
```

Quickstart
============

### Basic configuration

First install the package into your project (see above).

Open settings.py and add mailqueue to your INSTALLED_APPS:

```python
INSTALLED_APPS = (
    'mailqueue',
)
```

Add the below settings, and adjust as needed:

```python

# If you're using Celery, set this to True
MAILQUEUE_CELERY = False

# Enable the mail queue. If this is set to False, the mail queue will be disabled and emails will be 
# sent immediately instead.
MAILQUEUE_QUEUE_UP = True

# Maximum amount of emails to send during each queue run
MAILQUEUE_LIMIT = 50

# If MAILQUEUE_STORAGE is set to True, will ignore your default storage settings
# and use Django's filesystem storage instead (stores them in MAILQUEUE_ATTACHMENT_DIR) 
MAILQUEUE_STORAGE = False
MAILQUEUE_ATTACHMENT_DIR = 'mailqueue-attachments'

```

### Running the migrations

Once you've added mailqueue to your `INSTALLED_APPS` plus the basic config in settings.py, run the 
migrations to create the tables needed:


```bash
python manage.py migrate
```

### Basic usage of the queue programmatically

Simply save an email to the database using `MailerMessage`, and the queue will pick it up on it's next run.

```python

from mailqueue.models import MailerMessage

my_email = "dave@example.com"
my_name = "Dave Johnston"
content = """
Dear John,

This is an example email from Dave.

Thanks,
Dave Johnston!
"""

msg = MailerMessage()
msg.subject = "Hello World"
msg.to_address = "john@example.com"

# For sender names to be displayed correctly on mail clients, simply put your name first
# and the actual email in angle brackets 
# The below example results in "Dave Johnston <dave@example.com>"
msg.from_address = '{} <{}>'.format(my_name, my_email)

# As this is only an example, we place the text content in both the plaintext version (content) 
# and HTML version (html_content).
msg.content = content
msg.html_content = content
msg.save()


``` 




### Triggering the queue runner


To send emails in the queue (without Celery), use the management command:

```bash
# Send up to MAILQUEUE_LIMIT emails now
python manage.py send_queued_messages

# You can use --limit / -l to override the settings.py limit for a specific run
python manage.py send_queued_messages --limit 10
python manage.py send_queued_messages -l 10
```

If not using Celery, simply add a cron to your system to run `manage.py send_queued_messages` every minute (or however
often you want).



Documentation
-------------

http://readthedocs.org/docs/django-mail-queue/en/latest/

Mail Queue provides an admin interface to view all attempted emails and actions for resending failed messages.

![Screenshot of Email List](https://cdn.privex.io/github/privex-mail-queue/pmq-message-list.png)

![Screenshot of Email Actions](https://cdn.privex.io/github/privex-mail-queue/pmq-message-actions.png)


Support/Help/Spam/Hate Mail
---------------------------

If you have questions/problems/suggestions the quickest way to reach me to is simply add a GitHub issue to this project.

Running the Tests Locally
-------------------------

```
pip install django
pip install -r requirements.txt

py.test mailqueue
```



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/Privex/django-mail-queue",
    "name": "django-mail-queue",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "django-mail-queue",
    "author": "Privex Inc. (2019+) / Derek Stegelman (2011-2018)",
    "author_email": "chris@privex.io",
    "download_url": "https://files.pythonhosted.org/packages/26/8e/cd0a860b4f91b0f0b41638e68fb3812978e55f2a6e534631d92fc91f701c/django-mail-queue-3.2.6.tar.gz",
    "platform": null,
    "description": "[![Build Status](https://travis-ci.org/Privex/django-mail-queue.png?branch=master)](https://travis-ci.org/Privex/django-mail-queue)\n[![PyPi Version](https://img.shields.io/pypi/v/django-mail-queue.svg)](https://pypi.org/project/django-mail-queue/)\n![License Button](https://img.shields.io/pypi/l/django-mail-queue) ![PyPI - Downloads](https://img.shields.io/pypi/dm/django-mail-queue)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-mail-queue) \n![GitHub last commit](https://img.shields.io/github/last-commit/Privex/django-mail-queue)\n\nDjango Mail Queue\n=================\n\nThis is a fork of http://github.com/dstegelman/django-mail-queue maintained by [Privex Inc.](https://www.privex.io/)\n\nDerek passed on ownership of the original `django-mail-queue` PyPi package to Privex on 17 Sep 2019\n\nPrivex publishes the fork under the original PyPi package `django-mail-queue` (since v3.2.0).\n\nThis fork is considered to be actively maintained by Privex for both bug fixes and feature additions since\nDecember 2018. \n\nIf our fork has helped you, consider \n[grabbing a VPS or Dedicated Server from Privex](https://www.privex.io/) - prices start at as little \nas US$0.99/mo (yes that's 99 cents a month, and we take cryptocurrency!)\n\nMail Queue provides an easy and simple way to send email.  Each email is saved and queued up either in\nreal time or with Celery.  As always, feedback, bugs, and suggestions are welcome.\n\n\n\nInstall\n========\n\n`django-mail-queue` maintains high compatibility, from as old as Django 1.8 on Python 2.7, up to Django 2.2 on \nPython 3.7\n\nTo check the compatibility, see [Travis CI](https://travis-ci.org/Privex/django-mail-queue), which runs the unit\ntests on a variety of Python and Django versions.\n\n### Download and install from PyPi using pip (recommended)\n\n```sh\npip3 install django-mail-queue\n```\n\n### (Alternative) Manual install from Git\n\n**Option 1 - Use pip to install straight from Github**\n\n```sh\npip3 install git+https://github.com/Privex/django-mail-queue\n```\n\n**Option 2 - Clone and install manually**\n\n```bash\n# Clone the repository from Github\ngit clone https://github.com/Privex/django-mail-queue\ncd django-mail-queue\n\n# RECOMMENDED MANUAL INSTALL METHOD\n# Use pip to install the source code\npip3 install .\n\n# ALTERNATIVE MANUAL INSTALL METHOD\n# If you don't have pip, or have issues with installing using it, then you can use setuptools instead.\npython3 setup.py install\n```\n\nQuickstart\n============\n\n### Basic configuration\n\nFirst install the package into your project (see above).\n\nOpen settings.py and add mailqueue to your INSTALLED_APPS:\n\n```python\nINSTALLED_APPS = (\n    'mailqueue',\n)\n```\n\nAdd the below settings, and adjust as needed:\n\n```python\n\n# If you're using Celery, set this to True\nMAILQUEUE_CELERY = False\n\n# Enable the mail queue. If this is set to False, the mail queue will be disabled and emails will be \n# sent immediately instead.\nMAILQUEUE_QUEUE_UP = True\n\n# Maximum amount of emails to send during each queue run\nMAILQUEUE_LIMIT = 50\n\n# If MAILQUEUE_STORAGE is set to True, will ignore your default storage settings\n# and use Django's filesystem storage instead (stores them in MAILQUEUE_ATTACHMENT_DIR) \nMAILQUEUE_STORAGE = False\nMAILQUEUE_ATTACHMENT_DIR = 'mailqueue-attachments'\n\n```\n\n### Running the migrations\n\nOnce you've added mailqueue to your `INSTALLED_APPS` plus the basic config in settings.py, run the \nmigrations to create the tables needed:\n\n\n```bash\npython manage.py migrate\n```\n\n### Basic usage of the queue programmatically\n\nSimply save an email to the database using `MailerMessage`, and the queue will pick it up on it's next run.\n\n```python\n\nfrom mailqueue.models import MailerMessage\n\nmy_email = \"dave@example.com\"\nmy_name = \"Dave Johnston\"\ncontent = \"\"\"\nDear John,\n\nThis is an example email from Dave.\n\nThanks,\nDave Johnston!\n\"\"\"\n\nmsg = MailerMessage()\nmsg.subject = \"Hello World\"\nmsg.to_address = \"john@example.com\"\n\n# For sender names to be displayed correctly on mail clients, simply put your name first\n# and the actual email in angle brackets \n# The below example results in \"Dave Johnston <dave@example.com>\"\nmsg.from_address = '{} <{}>'.format(my_name, my_email)\n\n# As this is only an example, we place the text content in both the plaintext version (content) \n# and HTML version (html_content).\nmsg.content = content\nmsg.html_content = content\nmsg.save()\n\n\n``` \n\n\n\n\n### Triggering the queue runner\n\n\nTo send emails in the queue (without Celery), use the management command:\n\n```bash\n# Send up to MAILQUEUE_LIMIT emails now\npython manage.py send_queued_messages\n\n# You can use --limit / -l to override the settings.py limit for a specific run\npython manage.py send_queued_messages --limit 10\npython manage.py send_queued_messages -l 10\n```\n\nIf not using Celery, simply add a cron to your system to run `manage.py send_queued_messages` every minute (or however\noften you want).\n\n\n\nDocumentation\n-------------\n\nhttp://readthedocs.org/docs/django-mail-queue/en/latest/\n\nMail Queue provides an admin interface to view all attempted emails and actions for resending failed messages.\n\n![Screenshot of Email List](https://cdn.privex.io/github/privex-mail-queue/pmq-message-list.png)\n\n![Screenshot of Email Actions](https://cdn.privex.io/github/privex-mail-queue/pmq-message-actions.png)\n\n\nSupport/Help/Spam/Hate Mail\n---------------------------\n\nIf you have questions/problems/suggestions the quickest way to reach me to is simply add a GitHub issue to this project.\n\nRunning the Tests Locally\n-------------------------\n\n```\npip install django\npip install -r requirements.txt\n\npy.test mailqueue\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple Mail Queuing for Django",
    "version": "3.2.6",
    "project_urls": {
        "Homepage": "http://github.com/Privex/django-mail-queue"
    },
    "split_keywords": [
        "django-mail-queue"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0032006919b278e108f90e389faaacfa3384eff0fd3361575bf714c875445ca4",
                "md5": "0afd2edf154b7fcfc6ab27bb16f582d8",
                "sha256": "258f5f68efbea9aefef85f241dc27e0bd17543903331866c33a7fd1b66ff7f7f"
            },
            "downloads": -1,
            "filename": "django_mail_queue-3.2.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0afd2edf154b7fcfc6ab27bb16f582d8",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 19452,
            "upload_time": "2024-10-26T14:32:04",
            "upload_time_iso_8601": "2024-10-26T14:32:04.268548Z",
            "url": "https://files.pythonhosted.org/packages/00/32/006919b278e108f90e389faaacfa3384eff0fd3361575bf714c875445ca4/django_mail_queue-3.2.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "268ecd0a860b4f91b0f0b41638e68fb3812978e55f2a6e534631d92fc91f701c",
                "md5": "ce1318b02cd08b4e5337d95af0affe69",
                "sha256": "dae6d3baeba3dcdb3d38709cb50cae91f90d0642a627ed9e32f4f90a426f387e"
            },
            "downloads": -1,
            "filename": "django-mail-queue-3.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "ce1318b02cd08b4e5337d95af0affe69",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 12906,
            "upload_time": "2024-10-26T14:32:06",
            "upload_time_iso_8601": "2024-10-26T14:32:06.035585Z",
            "url": "https://files.pythonhosted.org/packages/26/8e/cd0a860b4f91b0f0b41638e68fb3812978e55f2a6e534631d92fc91f701c/django-mail-queue-3.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 14:32:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Privex",
    "github_project": "django-mail-queue",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pytest",
            "specs": [
                [
                    "==",
                    "3.1.2"
                ]
            ]
        },
        {
            "name": "pytest-django",
            "specs": [
                [
                    "==",
                    "3.1.2"
                ]
            ]
        },
        {
            "name": "pytest-flakes",
            "specs": [
                [
                    "==",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "pytest-pep8",
            "specs": [
                [
                    "==",
                    "1.0.6"
                ]
            ]
        },
        {
            "name": "factory_boy",
            "specs": [
                [
                    "==",
                    "2.8.1"
                ]
            ]
        }
    ],
    "lcname": "django-mail-queue"
}
        
Elapsed time: 1.59903s