Giter Site home page Giter Site logo

emailer's Introduction

Send emails with grades from a CSV file and attachments from a folder, using a template. Adapt to your needs.

Requirements

  • Haskell platform
    • You will need to cabal install several packages: parsec, cassava, MissingH.
    • For Hearts, you will also need bimap, random-shuffle, and graph-matchings.
  • Script works under cygwin. Modifications may be necessary for other shells.
    • Requires email. Do apt-cyg install email and follow instructions to configure email.
    • Look up the SMTP info from your email provider. Ex. for Princeton, see here. (Replace with smtp.princeton.edu for general Princeton email.)

Instructions

Emailing grades

  • Write an email and save it as email.txt. For fields that are customized, use a keyword (ex. NAME). (email.txt gives a sample.)

  • Customize Emailer.hs as desired.

    • It expects a CSV file with no header and with columns LAST NAME, FIRST NAME, ID, (HW GRADES), HW AVERAGE, EXAM, FINAL AVERAGE.
    • Customize it with which fields you want to replace, ex. NAME with name.
    • Put all the attachments with students' names in one directory.
  • Compile: ghc Emailer.

  • Run ./Emailer with arguments. See sample_script.

    ./Emailer "Subject" "from@domain" "cc@domain" "C:/dir/to/files/" "grades.csv" "email.txt" "@domain" "output_name"

  • Script will try to find attachment corresponding to each person. (Best to name the attachments LASTNAME_FIRSTNAME.pdf, for example.) For each attachment name it can't resolve, it will ask you to enter the file name.

  • Script produces one text file for each email.

  • Run the output file (default: email_grades). WARNING: This sends out all emails; you may want to check the text files first!

Heart-to-heart

This is a script for pairing people with conversation partners. The flags are:

  • -w week number (default: 1)
  • -c csv file (default: responses.csv)
  • -f from email (default: [email protected])
  • -m match email (default: hearts.txt
  • -n no-match email, for people who can't make it this week (default: pass.txt)
  • -d odd-one-out email, for an unmatched person when there are an odd number of participants (default: odd.txt)
  • -o output file (default: output_<week number>.txt)
  • -q questions file (default: questions.txt)
  • -s output script (default: script_<week number>) (the no-match script has _n appended to it)
  • -i input data (default: data_<week number - 1>.txt)
  • -d output data (default: data_<week number>.txt)
  • -e file with people to exclude for this week (default: exclude_<week number>.txt) (a list of emails, one on each line)

NOTE: The CSV reader expects a newline at the end. If you have parsing errors, check that this is true.

Setup:

  • Compile: ghc Hearts.
  • Collect responses with a form (such as this), and download it as responses.csv. (See note above on CSV parsing.)
  • Put the email text in hearts.txt, pass.txt, and odd.txt. Put the questions in questions.txt.
  • Initialize data_0.txt with a list of pairs of ID's of people who already know each other (so they won't be matched), in quotes. The ID is the row number (the first person is 1). Example:
    "1","2"
    "3","4"
    
    
  • For week <k>, write the emails of people to be excluded in exclude_<k>.txt, each on a separate line.

Example (for week 2):

 # create emails
./Hearts -w2
 # sends emails for matches
./script_2
 # sends emails for unmatched
./script_2_n

emailer's People

Watchers

James Cloos avatar Holden Lee 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.