Coder Social home page Coder Social logo

mail-scheduler's Introduction

Mail Scheduler

An example of automated mail sender using Flask-Mail and asynchronous job scheduling with RQ.

Setup

Configuration

Rename .env.example to .env And then set your variable there.

Quickly run the project using docker and docker-compose:

docker-compose up -d

Create the database tables:

docker-compose run --rm app flask create_db

Asynchronous job scheduling with RQ

RQ is a simple job queue for python backed by redis.

Start a worker:

flask rq worker

Start a scheduler:

flask rq scheduler

Monitor the status of the queue:

flask rq info --interval 3

For help on all available commands:

flask rq --help

How to use

Go to http://0.0.0.0:5000/api/doc

Or you can run in your terminal

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \ 
   "subject": "Email subject", \ 
   "content": "Email body", \ 
   "timestamp": "07 Feb 2018 00:06 +08", \ 
   "recipients": "user1%40mail.com, user2%40mail.com" \ 
 }' 'http://127.0.0.1:5000/api/save_emails'

mail-scheduler's People

Contributors

hveda avatar dependabot[bot] avatar

Watchers

James Cloos avatar

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.