Newsletter application for the Django web framework. This repo was forked from django-newsletter in August 2022 and aims to add more features, and fix bugs.
pip install git+https://github.com/MecSimCalc/django-newsletter.git@master
Django Rest Framework (DRF) API endpoint to GET
and POST
user subscriptions
GET Request:
Gets the subscription of signed in user to all newsletters.
GET
: http://localhost:8000/newsletter/my_subscriptions/
Returns:
[
{
"user": "585c0a22-0e70-42f5-afa5-05958a99c149",
"newsletter": {
"id": 1,
"title": "Announcements",
"slug": "announcements"
},
"subscribed": false
},
{
"user": "585c0a22-0e70-42f5-afa5-05958a99c149",
"newsletter": {
"id": 2,
"title": "Blog",
"slug": "blog"
},
"subscribed": false
}
]
POST Request:
Sets subscription to newsletters for signed in user.
POST
: http://localhost:8000/newsletter/my_subscriptions/
Request body:
[
{
"newsletter": 2,
"subscribed": true
},
{
"newsletter": 3,
"subscribed": true
}
]
- Implemented the fix suggested by Send submission to entire newsletter if subscriptions are empty #110
- Can export your Users list from Django admin as a csv file
- When importing Users by uploading a CSV file, it will first check to see if the email address exists for a User object. If it does, it will link it by a ForeignKey.
In models.py, attachment.file.path
will throw an error in s3 backends since .path
is not supported!
for attachment in attachments:
message.attach_file(attachment.file.path)
Error:
raise NotImplementedError("This backend doesn't support absolute paths.")
NotImplementedError: This backend doesn't support absolute paths.
Fix: download file from s3 url into /tmp
file and use that as the filepath
Django app for managing multiple mass-mailing lists with both plaintext as well as HTML templates with rich text widget integration, images and a smart queueing system all right from the admin interface.
We are currently using this package in several large to medium scale production environments, but it should be considered a permanent work in progress.
Extended documentation is available on Read the Docs.
Strings have been fully translated to a lot of languages with many more on their way.
Contributions to translations are welcome through Transifex. Strings will be included as soon as near-full coverage is reached.
Currently, django-newsletter officially supports Django 2.2.x LTS, 3.1.x and 3.2.x and Python 3.7 through 3.10.
Please refer to requirements.txt for an updated list of required packages.
Fairly extensive tests are available for internal frameworks, web (un)subscription and mail sending. Sending a newsletter to large groups of recipients (+15k) has been confirmed to work in multiple production environments. Tests for pull req's and the master branch are automatically run through GitHub Actions.
Want to contribute, great!
Please refer to the issues on GitHub and read CONTRIBUTING.rst.
If you find any bugs or have feature request for django-newsletter, don't hesitate to open up an issue on GitHub (but please make sure your issue hasn't been noticed before, finding duplicates is a waste of time). When modifying or adding features to django-newsletter in a fork, be sure to let me know what you're building and how you're building it. That way we can coordinate whether, when and how it will end up in the main fork and (eventually) an official release.
In general: thanks for the support, feedback, patches and code that's been flowing in over the years! Django has a truly great community. <3
This application is released under the GNU Affero General Public License version 3.