Skip to content

VicTorQuest/Newsletter-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Emailing Newsletter System with Django and Gmail SMTP

This project is a robust emailing newsletter system built using Django and integrated with Gmail SMTP for reliable email delivery. It provides a convenient way to manage and send newsletters to a large number of subscribers.

Installation

  1. Clone the repository:
  git clone https://github.com/VicTorQuest/Newsletter-system.git
  1. Install the required dependencies
  pip install -r requirements.txt
  1. Configure the Django settings.py file.
  • Secret Key: Create a .env file in the project root directory and generate a new secret key then add the following line:
  SECRET_KEY=your-secret-key-goes-here

Then, in settings.py, update the secret key assignment as follows:

  import os
  SECRET_KEY = os.environ.get('SECRET_KEY')
  • Django reCAPTCHA: If you plan to use reCAPTCHA for spam protection, add the following lines to your .env file:
  RECAPTCHA_SITE_KEY=your-recaptcha-site-key-goes-here
  RECAPTCHA_SECRET_KEY=your-recaptcha-secret-key-goes-here

In settings.py, update the reCAPTCHA settings as follows:

  RECAPTCHA_PUBLIC_KEY = os.environ.get('RECAPTCHA_PUBLIC_KEY')
  RECAPTCHA_PRIVATE_KEY = os.environ.get('RECAPTCHA_PRIVATE_KEY')
  RECAPTCHA_REQUIRED_SCORE = 0.85
  • Configure the Django settings.py file with your Gmail SMTP credentials.
  EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
  EMAIL_HOST = 'smtp.gmail.com'
  EMAIL_PORT = 587
  EMAIL_USE_TLS = True
  EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER')
  EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD')
  APPLICATION_EMAIL = EMAIL_HOST_USER
  DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
  1. Run database migrations: python manage.py migrate

  2. Start the development server: python manage.py runserver

Ensure that you have the python-dotenv package installed (pip install python-dotenv) to enable loading environment variables from the .env file.

Please note that the secret key should be kept confidential and not shared publicly. Make sure to replace 'your-secret-key-goes-here' with a secure and unique secret key.

If you decide to use Django reCAPTCHA for spam protection, obtain your reCAPTCHA site key and secret key from the reCAPTCHA website and replace 'your-recaptcha-site-key-goes-here' and 'your-recaptcha-secret-key-goes-here' respectively.

Features

  • Subscriber Management: Easily add, edit, and remove subscribers from the mailing list.
  • Subscription Management: Allow subscribers to manage their preferences and unsubscribe if desired.
  • SPAM Protection: Implemented measures to prevent newsletters from being marked as spam.
  • Integration with Gmail SMTP: Utilize the reliable and secure Gmail SMTP service for email delivery.

Usage

  1. Access the admin panel at http://127.0.0.1:8000/admin and create an admin account
  python manage.py createsuperuser
  1. Add subscribers to the mailing list.

3. Create and schedule newsletters to be sent to the subscribers.

Contributing

Contributions are always welcome!

Acknowledgements

Special thanks to the Django and Gmail teams for their excellent frameworks and services, which made this project possible.

Contact

For any inquiries or feedback, please contact me at victorokolie001@gmail.com

Let's make email newsletters a breeze with Django and Gmail SMTP!

About

An emailing newsletter system with Django and Gmail smtp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors