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")
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
Add to your .env
:
POSTMARK_KEY={SECTET_KEY}
POSTMARK_TEST_KEY=POSTMARK_API_TEST
[email protected]
[email protected]
npm start
- run client in dev mode (test API key, no live emails)npm run start:prod
- run client in production mode
body-parser
- Extract JSON body from requestscross-env
- Allow setting env variables in npm scriptsdotenv
- Allow use of .env variablesexpress
- Server routing / listeningpg
- Manages node postgres connectionpostmark
- Postmark node client (https://wildbit.github.io/postmark.js/)
Endpoints which only address a single user
POST: localhost:3000/s/attempting/started
Body: { email, issue, name }
- User has started attempting an issue
POST: localhost:3000/s/attempting/reminder
Body: { email, issue, name }
- Reminder to check in on issue after 30 days
POST: localhost:3000/s/company/welcome
Body: { email, issue, name }
- Notify the user of new comments on an issue they posted
POST: localhost:3000/s/issues/newComment
Body: { email, issue, name }
- Notify the user of new comments on an issue they posted
POST: localhost:3000/s/issues/newPullRequest
Body: { email, issue, name }
- A new pull request has been submitted for your issue
POST: localhost:3000/s/issues/attempting
Body: { email, issue, name }
- A user has marked your issue as Attempting
POST: localhost:3000/s/issues/resolved
Body: { email, issue, name }
- Your issue has been resolved
POST: localhost:3000/s/issues/closed
Body: { email, issue, name }
- Your issue has been closed
POST: localhost:3000/s/funding/fundedAccount
Body: { amount, userId }
- Funding has been added to your account
POST: localhost:3000/s/funding/fundedIssue
Body: { email, issue, name }
- You funded an issue
POST: localhost:3000/s/funding/earnedBounty
Body: { fundedAmount, rep, userId }
- You have earned the bounty on an issue
POST: localhost:3000/s/funding/approvedBounty
Body: { fundedAmount, rep, userId }
- You have earned the bounty on an issue
POST: localhost:3000/s/hiring/signup
Body: { userId }
- You have signed up for the hiring platform
POST: localhost:3000/s/pullRequests/submitted
Body: { userId, pullrequestId }
- You have submitted a pull request
POST: localhost:3000/s/pullRequests/merged
Body: { email, issue, name }
- Your pull request has been merged in
POST: localhost:3000/s/users/welcome
Body: { userId }
- Welcome to Rysolv
POST: localhost:3000/s/users/recommendations
Body: { issueList, userId }
- Check out some new issues you might like
POST: localhost:3000/b/attempting/pullRequest
Body: { issueId }
- A new pull request has been submitted
POST: localhost:3000/b/attempting/closed
Body: { issueId }
- Issue has been closed
POST: localhost:3000/b/attempting/resolved
Body: { issueId }
- The issue you were attempting has been resolved (name winner)
POST: localhost:3000/b/funding/issueResolved
Body: { issueId }
- And issue you funded has been resolved
POST: localhost:3000/b/funding/refunded
Body: { issueId }
- A contribution has been refunded to your account
POST: localhost:3000/b/pullRequests/newPullRequest
Body: { issueId }
- A new pull request has been submitted
POST: localhost:3000/b/pullRequests/merged
Body: { issueId }
- A pull request has been merged in
POST: localhost:3000/b/pullRequests/funded
Body: { issueId }
- Increased bounty on issue
POST: localhost:3000/b/pullRequests/closed
Body: { issueId }
- An issue you submitted a PR on has been closed
POST: localhost:3000/b/pullRequests/resolved
Body: { issueId }
- An issue you submitted a PR on has been resolved
POST: localhost:3000/b/watching/newPullRequest
Body: { issueId }
- A new pull request has been submitted
POST: localhost:3000/b/watching/funded
Body: { issueId }
- New funding
POST: localhost:3000/b/watching/resolved
Body: { issueId }
- Issue has been resolved