Git Product home page Git Product logo

rysolv_email's Introduction

rysolv_email api

This API handles all outgoing emails from rysolv.com. It is primarily broken into two categories:

  • Single: real time response to a user's actions (ex: "You submitted a pull request")
  • Batch: Sent to groups of users (ex: "Issue #42 has been resolved")

Running

Configuring the DB

Create a .env with the following inputs (matching your local db). Will be used in ~/connect.js

  • DB_USER=user
  • DB_PASSWORD=password
  • DB_PORT=5432
  • DB_HOST=localhost
  • DB_NAME=rysolv

Configuring PostMark

Add to your .env:

Scripts

  • npm start - run client in dev mode (test API key, no live emails)
  • npm run start:prod - run client in production mode

Dependencies

  • body-parser - Extract JSON body from requests
  • cross-env - Allow setting env variables in npm scripts
  • dotenv - Allow use of .env variables
  • express - Server routing / listening
  • pg - Manages node postgres connection
  • postmark - Postmark node client (https://wildbit.github.io/postmark.js/)

API Routes

Single Email Endpoints

Endpoints which only address a single user

/s/attempting

Start Attempting

POST: localhost:3000/s/attempting/started
Body: { email, issue, name }
  • User has started attempting an issue

Reminder

POST: localhost:3000/s/attempting/reminder
Body: { email, issue, name }
  • Reminder to check in on issue after 30 days

/s/company

Welcome

POST: localhost:3000/s/company/welcome
Body: { email, issue, name }
  • Notify the user of new comments on an issue they posted

/s/issues

New Comments

POST: localhost:3000/s/issues/newComment
Body: { email, issue, name }
  • Notify the user of new comments on an issue they posted

New Pull Request

POST: localhost:3000/s/issues/newPullRequest
Body: { email, issue, name }
  • A new pull request has been submitted for your issue

Attempting

POST: localhost:3000/s/issues/attempting
Body: { email, issue, name }
  • A user has marked your issue as Attempting

Resolved

POST: localhost:3000/s/issues/resolved
Body: { email, issue, name }
  • Your issue has been resolved

Closed

POST: localhost:3000/s/issues/closed
Body: { email, issue, name }
  • Your issue has been closed

/s/funding

Account Funded

POST: localhost:3000/s/funding/fundedAccount
Body: { amount, userId }
  • Funding has been added to your account

Issue Funded

POST: localhost:3000/s/funding/fundedIssue
Body: { email, issue, name }
  • You funded an issue

Earned Bounty

POST: localhost:3000/s/funding/earnedBounty
Body: { fundedAmount, rep, userId }
  • You have earned the bounty on an issue

Approved Bounty

POST: localhost:3000/s/funding/approvedBounty
Body: { fundedAmount, rep, userId }
  • You have earned the bounty on an issue

/s/hiring

Hiring form submitted

POST: localhost:3000/s/hiring/signup
Body: { userId }
  • You have signed up for the hiring platform

/s/pullRequests

Pull request submitted

POST: localhost:3000/s/pullRequests/submitted
Body: { userId, pullrequestId }
  • You have submitted a pull request

Pull request merged

POST: localhost:3000/s/pullRequests/merged
Body: { email, issue, name }
  • Your pull request has been merged in

/s/auth

Welcome email

POST: localhost:3000/s/users/welcome
Body: { userId }
  • Welcome to Rysolv

/s/users

Recommendations email

POST: localhost:3000/s/users/recommendations
Body: { issueList, userId }
  • Check out some new issues you might like


Batch Email Endpoints

/b/attempting

New Pull Request

POST: localhost:3000/b/attempting/pullRequest
Body: { issueId }
  • A new pull request has been submitted

Issue Closed

POST: localhost:3000/b/attempting/closed
Body: { issueId }
  • Issue has been closed

Issue Resolved

POST: localhost:3000/b/attempting/resolved
Body: { issueId }
  • The issue you were attempting has been resolved (name winner)

/b/funding

Issue Resolved

POST: localhost:3000/b/funding/issueResolved
Body: { issueId }
  • And issue you funded has been resolved

Funding Returned

POST: localhost:3000/b/funding/refunded
Body: { issueId }
  • A contribution has been refunded to your account

/b/pullRequests

New pull request

POST: localhost:3000/b/pullRequests/newPullRequest
Body: { issueId }
  • A new pull request has been submitted

Pull request merged

POST: localhost:3000/b/pullRequests/merged
Body: { issueId }
  • A pull request has been merged in

Increased Bounty

POST: localhost:3000/b/pullRequests/funded
Body: { issueId }
  • Increased bounty on issue

Issue Closed

POST: localhost:3000/b/pullRequests/closed
Body: { issueId }
  • An issue you submitted a PR on has been closed

Issue Resolved

POST: localhost:3000/b/pullRequests/resolved
Body: { issueId }
  • An issue you submitted a PR on has been resolved

/b/watching

New Pull Request

POST: localhost:3000/b/watching/newPullRequest
Body: { issueId }
  • A new pull request has been submitted

Increased funding

POST: localhost:3000/b/watching/funded
Body: { issueId }
  • New funding

Issue Resolved

POST: localhost:3000/b/watching/resolved
Body: { issueId }
  • Issue has been resolved

rysolv_email's People

Contributors

tylermaran avatar annapo23 avatar

Watchers

 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.