Skip to content

will-mcintyre04/quote-emailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mindfuel Quote Emailer

Author: Will McIntyre
Date: 2023-09-07

Python SQLAlchemy SQLite MySQL HTML5 CSS3


Description

This script encapsulates the back-end database management/editing, quote API fetching and email sending of the Mindfuel web app.

Mindfuel is a web application designed to inspire and motivate its users with daily quotes delivered to their inbox. This Python script automates the process by fetching motivational quotes from the ZenQuotes API and sending them to subscribers via email.

See below for an example of the email template:


Note: click here to subribe to the official Mindfuel quote emails.

Features

  • Subscriber Management: Allows you to add and delete subscribers to/from the mailing list.

  • Status Display: Provides information about the current status of the mailing list (development or production environment and email address display)

  • Email Sending: Sends inspirational quotes from a configured email address to all subscribers on the mailing list from a secure SSL/TLS-encrytped connection.

Usage

To run the Mindfuel Quote Emailer, follow these steps in bash:

  1. Clone or download this repository to your local machine and navigate to quote-emailer directory:

    git clone https://github.com/will-mcintyre04/quote-emailer.git
    
    cd quote-emailer
  2. Install all required dependancies into your local environment:

    pip install -r requirements.txt
    
  3. Create a .env file in your local directory

    touch .env
  4. Configure mailing and database environment

    First, confiugure the local database environment (development produces a local db)

    python motivation_mailer.py -db dev

    Make sure to create a google application password for the sending email address.


    Finally, setup the email environment within the script (replacing YOUR_ADDRESS and YOUR_APP_PASS) with the sending address and app password created previously.

    python motivation_mailer.py -a YOUR_ADDRESS
    
    python motivation_mailer.py -p YOUR_APP_PASS
  5. Run the script using the following commands:

    python motivation_mailer.py [options]

    Replace [options] with any of the following command-line options:

    -h, --help            show this help message and exit
    --status, -s          Displays configuration environment and lists all subscribers
    --add ADD [ADD ...], -a ADD [ADD ...]
                          Email address(es) to add to database
    --delete DELETE [DELETE ...], -d DELETE [DELETE ...]
                          Email address(es) to delete from database
    --database DATABASE, -db DATABASE
                          Sets database configuration ('production' or 'development')
    --email EMAIL, -e EMAIL
                          Sets the sending email address
    --password PASSWORD, -p PASSWORD
                          Sets the sending email password
    --send                Sends emails to the emails stored in the db

About

Modular quote emailing script for Mindfuel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors