Code Monkey home page Code Monkey logo

email-sender's Introduction

How to install and run

> python get-pip.py

> pip install requests

> pip install nose

  • Get an API key from Mailfun (https://mailgun.com/cp)
  • Get an API key from Mandrill (http://mandrill.com/)
  • mv your config/*ini.local files to config/*ini
  • Update the config/ files with the appropriate usernames/passwords/keys
  • You can now run the tests with nosetests -v
  • You can start the server with python email_sender.py and hit it with a properly formatted curl request. One example is here:
curl -i -H "Accept: application/json" -H "Content-Type: x-www-form-urlencoded" -X POST -d '{"to": "<email>", "to_name": "<name>", "from": "<email>", "from_name": "<from>", "subject": "<subject>", "body": "<body>"'} http://localhost:5000/email

Tactical Decisions

Language and Framework Choices

I chose to write this in Python because I love the simplicity of it and it's my go-to language for small projects like this. I chose Flask for my microframework because it was the first one I found (and the community and support behind it seemed more mature compared to Bottle for instance). I used pip because it was the biggest Python package manager I found. Requests allowed me to create the POST requests very easily to send off to Mailgun and Mandrill. I used Nose to gather all my tests and run them seamlessly.

What-ifs and Trade-offs

I would like more experience in learning the conventions of project structure for Python projects. My code was placed by how I felt it should logically be, which is not necessarily the best place. One issue I ran into was my server and my tests were running in different places, so the ConfigParser which read the configuration files would run into pathing issues. This is also my first run-in with working closely with HTTP request, so some of my expected HTTP responses and errors might be off.

email-sender's People

Contributors

calvinlsliang avatar

Watchers

 avatar James Cloos avatar

Forkers

cinno

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.