The following outlines the details for collaborating on this Node application.
You will need the following things properly installed on your computer.
Note: Due to the dependency on Crontab, this application will not run easily on Windows.
-
git clone git@github.com:bocoup/email
this repository -
cd email
change into the new directory -
mkdir config && scp nest.bocoup.com:/mnt/secrets/ses.json config
- get creds -
npm install
install the third-party dependencies
Note: If you are forking this for personal use, AWS credentials must be provided at ./config/ses.json
in the following format:
{
"key": "AWS_KEY",
"secret": "AWS_SECRET"
}
By design this application is meant to be standalone on a server and act as a server daemon. If you would like to directly integrate with your pre-existing server, this application also acts as express middleware.
The Bocoup E-Mail API should follow JSON-API for errors and data. You must set the content type request header to JSON.
Note: jQuery and other popular request libraries may add this automatically.
Content-Type: application/json
The API is versioned and the current stable is v1. Therefore you should format your requests like so:
http://email.bocoup.com/api/v1/
This is the endpoint you'll hit when you want to immediately send an email. Useful for one off emails, such as new account registration or forgot password.
Description | URL | Method | Request | Response |
---|---|---|---|---|
Send an e-mail | `/send` | `POST` |
|
Body:
|
These are jobs that are executed on a specific schedule. They are assigned using Crontab, and allow any valid schedule expression within that format. You would use this endpoint to schedule emails to be sent every day/month/year, schedule an email to be sent 5 minutes from now, etc.
Description | URL | Method | Request | Response |
---|---|---|---|---|
Create a new poller | `/poll` | `POST` |
|
|
Create or update new poller | `/poll` | `PUT` |
|
|
Get all pollers | `/poll` | `GET` |
|
|
Get a specific poller | `/poll/:id` | `GET` |
|
|
Delete a specific poller | `/poll/:id` | `DELETE` |
|
|
npm start
- Visit your app at http://localhost:8000.
npm test
vagrant up
Deploy & Provision:
npm run deploy
npm run provision
OR (more verbose)
./deploy/deploy-production.sh
./deploy/provision-production.sh