Coder Social home page Coder Social logo

sendgrid / nodejs-http-client Goto Github PK

View Code? Open in Web Editor NEW
19.0 125.0 54.0 281 KB

This repo is no longer maintained. Please use https://github.com/sendgrid/sendgrid-nodejs/tree/HEAD/packages/client instead

Home Page: https://sendgrid.com

License: MIT License

JavaScript 99.19% Dockerfile 0.11% Makefile 0.70%

nodejs-http-client's Introduction

This repo is no longer maintained. Please use https://github.com/sendgrid/sendgrid-nodejs/tree/HEAD/packages/client instead.

SendGrid Logo

Build Status Email Notifications Badge npm version Twitter Follow GitHub contributors MIT license

Quickly and easily access any RESTful or RESTful-like API.

If you are looking for the SendGrid API client library, please see this repo.

Announcements

All updates to this library are documented in our CHANGELOG.

Table of Contents

Installation

Prerequisites

  • Node.js version 0.10, 0.12 or 4

You need to have a API key to use the app. To configure the API key in the environment variables follow these steps.

  • create .env file in the root directory of the project.
  • Copy the contents of .env_sample file in to the .env file
  • Once you have obtained the API key, find the environment variable SENDGRID_API_KEY and assign your API key as it's value. As an example it should look like this
SENDGRID_API_KEY='<YOUR_API_KEY>';

Install Package

npm install sendgrid-rest

Quick Start

GET /your/api/{param}/call

var Client = require('sendgrid-rest').Client
var client = new Client()
var request = client.emptyRequest()
var param = 'myparam'
request.host = 'api.example.com'
request.method = 'GET'
request.path = '/your/api/' + param + '/call'
client.API(request, function (response) {
  console.log(response.statusCode)
  console.log(response.body)
  console.log(response.headers)
})

POST /your/api/{param}/call with headers, query parameters and a request body.

var Client = require('sendgrid-rest').Client
var client = new Client()
var request = client.emptyRequest()
request.host = 'api.example.com'
request.headers['Authorization'] = 'Bearer XXXXXX'
request.queryParams['limit'] = 100
request.queryParams['offset'] = 0
request.method = 'POST'
var param = 'myparam'
request.path = '/your/api/' + param + '/call'
requestBody = {
  'some': 0,
  'awesome': 1,
  'data': 3
}
request.body = requestBody
client.API(request, function (response) {
  console.log(response.statusCode)
  console.log(response.body)
  console.log(response.headers)
})

Usage

Following is an example using SendGrid. You can get your free account here.

First, update your environment with your SENDGRID_API_KEY.

You can copy the .env_example file located in the "examples" folder to .env in your project's root.

cp examples/.env_sample .env

Once you have edited the file and added your API Key, you can add the variable to your environment: source .env

Here is the full working code.

To run the example:

node examples/example

======= Library Usage Documentation

Tests

Tests can be run through a Docker container which is defined in the docker-compose.yml file.

To run the tests, simply run docker-compose up.

Roadmap

If you are interested in the future direction of this project, please take a look at our milestones. We would love to hear your feedback.

How to Contribute

We encourage contribution to our libraries, please see our CONTRIBUTING guide for details.

About

nodejs-http-client is maintained and funded by Twilio SendGrid, Inc. The names and logos for nodejs-http-client are trademarks of Twilio SendGrid, Inc.

If you need help installing or using the library, please check the Twilio SendGrid Support Help Center.

If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!

License

The MIT License (MIT)

nodejs-http-client's People

Contributors

annaelde avatar cantremember avatar dependabot[bot] avatar derekkramer avatar dhsrocha avatar dilpreetsio avatar flaredragon avatar gr8shivam avatar iifeoluwa avatar jeffgerlach avatar jppferguson avatar krlevkirill avatar luan-cestari avatar luiscoms avatar maxtotterman avatar mbernier avatar mithunsasidharan avatar mptap avatar mukulmishra18 avatar onefastsnail avatar psnmissaka avatar pushkyn avatar robincher avatar sitegui avatar skshelar avatar strum355 avatar t2013anurag avatar thinkingserious avatar tonkpils avatar twilio-ci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodejs-http-client's Issues

Set up a docker container

Issue Summary

Use docker-compose to build a container that:

  • upon running, it executes all tests
  • it uses a local volume in docker-compose to allow caching of node_modules and local code edits to make changes in the container

Create first time contributor documentation

Issue Summary

Our open sourced documentation has a great first time contributor page that we wish to duplicate here.

Acceptance Criteria

  • We have a file in the root directory called first-timers.md or similar that helps a first time contributor make their first PR (please use our CONTRIBUTOR.md file for inspiration as well as this page)
  • We provide a link to tasks with the labels "difficulty: easy" and "status: help wanted" (example query) to all the repos listed here, please scroll to the bottom.

Document new Git workflow in CHANGELOG.md

Issue Summary

We want to update our git workflow to function more like Gitflow. We need to update the CONTRIBUTING.md file and PULL_REQUEST_TEMPLATE to direct contributors to fork/branch off the development branch and to merge their PRs with the development branch. Once this issue is complete, we will be creating the development branch and making that branch the default. This is part of a larger strategy to execute releases for this SDK on a predictable cadence.

Acceptance Criteria

  • Update CONTRIBUTING.md documentation, explaining the process of forking and branching off the development branch and submitting PRs agains the development branch.
  • Update PULL_REQUEST_TEMPLATE with the same addition to the CONTRIBUTING.md documentation.

What's the "globalRequest" object on the docs?

var Client = require('sendgrid-rest').Client
var emptyRequest = require('sendgrid-rest').request
var client = new Client(globalRequest)
var request = JSON.parse(JSON.stringify(emptyRequest))

Allow the ability to set custom port

Issue Summary

So I have a node server setup behind a corporate proxy. I've setup the server to use the proxy on all http and https request. However, my requests were getting blocked when trying to use the SendGrid node library. The reason they were getting blocked is either the proxy or the firewall wasn't letting the request past since it was using https but wasn't using port 443 in the request.

I noticed that the SendGrid node lib uses the sendgrid-rest lib to construct the request, I noticed the returned request has a empty port. Looking at the code I see that a basic request construction uses the following object:

// request holds the request to an API Call
var request = {
  host: '',
  method: '',
  path: '',
  headers: {},
  body: {},
  queryParams: {},
  test: false, // use this to allow for http calls
  port: ''     // set the port for http calls
}

And then uses the 'buildrequest' function to receive the endpoint request and update the values. But never updates the port. If I manually override the port value above to '443' the requests work.

 function buildRequest (globalRequest, endpointRequest) {
    var request = JSON.parse(JSON.stringify(globalRequest))
    request.host = endpointRequest.host || globalRequest.host
    request.method = endpointRequest.method

    // build URL
    request.path = !isEmpty(endpointRequest.queryParams)
      ? buildPath(endpointRequest.path, endpointRequest.queryParams)
      : endpointRequest.path

    // add headers
    if (!isEmpty(endpointRequest.headers)) {
      for (var attrname in endpointRequest.headers) {
        request.headers[attrname] = endpointRequest.headers[attrname]
      }
    }

    // add the request body's content length
    if (!isEmpty(endpointRequest.body)) {
      body = JSON.stringify(endpointRequest.body)
      request.headers['Content-Length'] = Buffer.byteLength(body)
      request.headers['Content-Type'] = 'application/json'
    }

    return request
  }

It would be nice if you could pass a port in the endpointRequest and have that applied to the port value on the request. We already allow it to pass the host and path etc, so would be just an extra field and and one extra check.

invoke the API callback upon Error

Issue Summary

When an Error is emitted by the http or https ClientRequest, the callback to the API method is never invoked. Thus, the caller is never informed that the request failed, and will wait forever.

In our case, a series of HTTP timeouts from the SendGrid API caused all of our asynchronous Workers to lock up waiting for responses that would never come.

Steps to Reproduce

  1. In the Test Suite, use nock to simulate a failure

    nock(TEST_HOST)
      .get('/test')
      .replyWithError('ERROR')
  2. Invoke the Test Case's done callback within the API's callback (vs. synchronously, regardless of whether the API callback is invoked or not)

  3. This will result in Error: timeout of 2000ms exceeded

Technical details:

  • node-http-client Version: master (latest commit: c4785c6)
  • Node.js Version: agnostic

There are several strategies to resolving this issue:

  • provide a mocked HTTP 500 response so that the callback gets a parseable Object. this could be considered a 'patch' release, since it would not crash any code which blindly expects an Object with statusCode, body and headers properties
  • invoke the callback with no argument, or with null. this could be thought of as breaking the API, because attempting to access a property on the non-existing Object will crash the caller. perhaps it could be excusable as a 'minor' release. also, the caller has no access to the emitted Error itself
  • change the callback over to CPS style -- a more traditional Node.js (err, response) argument signature -- and provide the emitted Error. this is definitely a 'major' release, but it aligns very closely with the "consistent callback function signature" approach in sendgrid/sendgrid-nodejs#261

Add/Update Badges on README

Similar to what was done on the SendGrid node README:

  • put the logo at the top of the list
  • Add License like so
  • make sure the other badges are available like so:
![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)

For the following, make sure the correct repo is linked!
For email notifications, you can change the "nodejs" to the language of this repo (e.g. java, python, ruby, php, csharp, go, etc)

[![BuildStatus](https://travis-ci.org/sendgrid/sendgrid-nodejs.svg?branch=master)](https://travis-ci.org/sendgrid/sendgrid-nodejs)
[![Email Notifications Badge](https://dx.sendgrid.com/badge/nodejs)](https://dx.sendgrid.com/newsletter/nodejs)
[![npm](https://img.shields.io/npm/l/express.svg)]()
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/sendgrid-nodejs.svg)](https://github.com/sendgrid/sendgrid-nodejs/graphs/contributors)

Thank you and happy #Hacktoberfest!!

Unit test Failing in node v8

Issue Summary

We have a test that seems to be failing in Node v8, but not in other versions.

Steps to Reproduce

  1. Go here
  2. Click 55.5 :: Node.js 8
  3. The error is reported at the bottom

This is blocking #22 from being merged.

Technical details:

  • Node.js Version: 8

Implement auto-deploy to package manager

Issue Summary

When all tests on the master branch pass in Travis CI, we would like to auto-deploy the release to the package manager.

Before writing any code, we suggest you review our CONTRIBUTING.md file and propose your solution for discussion here in the comments. Thank you!

Aceptance Criteria

  • when Travis CI passes all tests on the master branch we auto-deploy to the package manager
  • the version is determined by the CHANGELOG.md

Improve esdoc's coverage report

Issue Summary

Adding documentation is a great way to save yourself and other developers time when they are looking at code to understand what was coded or when they are troubleshooting an issue.

Steps to Reproduce

  1. clone this repo git clone https://github.com/sendgrid/nodejs-http-client.git
  2. run npm install
    a. If #42 is not complete or merged yet, npm i [email protected] esdoc esdoc-coverage-plugin
  3. run ./node_modules/.bin/esdoc
  4. Open the coverage.json file that was generated in the docs directory
  5. Find files that need more docs coverage and add it in!

Remove marked security vulnerability

Issue Summary

Reported by GitHub:

Known moderate severity security vulnerability detected in marked < 0.3.7 defined in package-lock.json.

package-lock.json update suggested: marked ~> 0.3.7.

Add a USAGE.md file

Usage files are really nice when they exist in a repo, because it makes it really obvious where to look for information about how to use this tool. It can be frustrating when you expect this file to be there and it's not.
Please add a USAGE.md file, you can see an example of this
here

Please make sure you modify the file for this repo (hint: Most of this information should be in the README file)

Add our Developer Experience Engineer career opportunity to the README

Issue Summary

The role of Developer Experience Engineer just became available and we want to announce it in the README. Here is the copy:

If you're a software engineer who is passionate about #DeveloperExperience and/or #OpenSource, this is an incredible opportunity to join our #DX team as a Developer Experience Engineer and work with @thinkingserious and @aroach! Tell your friends :)

Acceptance Criteria

  • The above announcement is added to the Announcements section of this README

Add unittest to check for specific repo files

This repo should have the following list of files included:

  • ./Docker or docker/Docker
  • ./docker-compose.yml or ./docker/docker-compose.yml
  • ./.env_sample
  • ./.gitignore
  • ./.travis.yml
  • ./.codeclimate.yml
  • ./CHANGELOG.md
  • ./CODE_OF_CONDUCT.md
  • ./CONTRIBUTING.md
  • ./.github/ISSUE_TEMPLATE
  • ./LICENSE.md
  • ./.github/PULL_REQUEST_TEMPLATE
  • ./README.md
  • ./TROUBLESHOOTING.md
  • ./USAGE.md
  • ./USE_CASES.md

This PR is only asking for tests of the existence of these files, if the files do not exist when you run the tests - do not worry about the tests not passing. We will identify this and create a new PR for the issue.
Thank you!

Add a .env_sample file

Our preference is that users have an environment file when using the SendGrid API, because it is less likely that someone would commit their credentials to github.

Please make a couple changes:

  • make a .env_sample file that contains: export SENDGRID_API_KEY=''
  • make (or add) a .gitignore file and include .env
  • add instructions to the README file about how to copy .env_sample to .env and add the API Key

Auto-generate the CHANGELOG.md file upon release

Issue Summary

For every release, we currently hand craft a CHANGELOG.md update, now we would like to automate this process. Please see the existing CHANGELOG.md for formatting structure.

Acceptance Criteria

  • A script, which when run, creates a CHANGELOG.md update based on any merged PRs since the last release.

Create a Use Cases Directory

Due to the success we have seen from hacktoberfest, we are seeing more people create use cases. This is amazing!
We want to make sure that everyone can find them. Please help us to break up this file and make it easier to read and manage:

  • Create a Use Cases Directory
  • Put a README.md in this directory
  • Make a file in the new directory for each individual Use Case from USE_CASES.md, copy the content to this file
  • For each file you've created, link to it from the README you created
  • Organize the links in the README by type
  • Make sure the names of the files you created are related to the Use Case
    Thank you!

Add a unittest to check the license.md file date range

The end year in the license file should be "this year" and this should be checked on every run of the tests. If the end year is no correct, fail the test.
example:

Copyright (c) 2012-2016 SendGrid, Inc.
It is 2017, so this should be:
Copyright (c) 2012-2017 SendGrid, Inc.
and the test should fail.
--done

Security vulnerability for [email protected]

Issue Summary

There are security vulnerabilities found in [email protected] sub-dependencies. The vulnerabilities found are marked as High-severity, so i thought it should bring this up for the team consideration since it will be a pretty straight-forward fix. The recommended fix is to upgrade mocha to version 4 (minimum)

Expected work to be done

  1. Update Mocha to version 4 (or 5) in package.json
  2. Update travis.yml to ensure travis only run up to node version supported by Mocha version 4 (or 5 the latest)

Steps to Reproduce

  1. npm install
  2. npm audit
  3. Analyse the output.

More information for the vulnerability :
https://snyk.io/test/npm/mocha/2.4.5

Technical details:

  • node-http-client Version: master (latest commit: [a341cf3])
  • Node.js Version:8.x.x

Auto-generate the release notes upon release

Issue Summary

For every release, we hand craft the release notes on GitHub, now we would like to automate this process. Please see the existing release notes for an example. The contents of the release notes are generated from the CHANGELOG.md file. Here is the documentation for updating the release notes via the GitHub API.

Acceptance Criteria

  • A script, which when run, creates a release note update based on the last deployed release

Require conformance to style standards

Issue Summary

In the CONTRIBUTING.md file there is a section on Style Guidelines & Naming Conventions. Please review and implement a check in Travis CI. If there are any style errors, either fix or create a rule to exclude the error.

Before writing any code, we suggest you review our CONTRIBUTING.md file and propose your solution for discussion here in the comments. Thank you!

Aceptance Criteria

  • TravisCI checks that the code conforms to our Style Guidelines & Naming Conventions as defined in our CONTRIBUTING.md file
  • tests pass locally, in Travis CI and using Docker

IP Warmup functionality integrated into mail helper

This issue has the potential to save other developers quite a bit of time and frustration when buying IP addresses because it will help them warm up the IPs appropriately. Warming up is a process of slowly ramping up sending on an IP address to allow Email Recipient servers (e.g. gmail, hotmail, etc) to see that this IP is legit.

Goal

  • Add the ability to automate warm up IPs that allows a customer to take a conservative or aggressive approach to how they warm up.
  • This should work for API purchased IPs or for IPs that are not warmed up yet.
  • It should pay attention to “warm up days” not calendar days
  • It should be able to calculate the IP’s warmup schedule without the need for a database or excessive API calls.
  • The functionality should use the names of the IP pools retrieved from the API rather than a database to track the IPs and where they are in the process (see below for more info).
  • This functionality should be able to be used in the nodejs mail helper, with a function call to "turn it on" during sending, but the code for this can be physically located in a helper called "Warmup".

Definitions:

  • poolName - This is the name of the pool, defined in the following way: warmup_warmupDay_lastSendDate. e.g. warmup_3_20170101. This naming convention allows the pool name to dictate the calculation of how many emails to send to this pool, without the need to track this information in a database. Day 1 warmup pools will be named warmup_1, because there is no lastSendDate.
  • warmupDay - If a day 3 pool is currently being used to send emails on Thursday, but it hasn’t sent emails since Monday, the warmup function will re-send using the day 2 limits rather than using the day 3 limits.
  • lastSendDate - The last calendar date that this pool was used on.
  • currentDailyVolume - The top end volume for a single day’s worth of sending
  • numIpsInThisPool - When retrieving pools, this is the number of IPs in this pool, as we will want to send the same warmup volume to each IP in the pool. As you send using a pool, SendGrid uses a round-robin to make sure the IPs are used evenly.
  • totalDaysToWarmup - This is the number of warmupDays (not calendar days) you would like to have your IPs spend warming. Default: 15
  • growthRate - This is the rate at which the warmupDay’s totalEmailsToSend is calculated, based on the other values that control warmup procedure
  • totalEmailsToSend - The number of emails to send to this pool on this warmupDay
  • resetDays - # of days allowed between today() and lastSendDate, default 1

Workflow

Purchased IP address

  • Customer purchases the IP over the API
  • The code, upon acknowledgement of the purchase adds the IP to a pool called warmup_1 [warmup_warmupDay] - note, there is no lastSendDate, because this pool has not been used to send to yet.
  • If the pool does not exist, please add it.
  • Go to Warmup Procedure, below

UI purchased IP Address

  • Customer purchases IP address via the UI
  • Customer manually adds the IP address to “warmup_1”
  • If the pool does not exist, please add it.
  • Go to Warmup Procedure, below

Warmup Procedure

  • In order to initiate the IP warmup process, customer adds the IP to the warmup_1 pool
  • Upon sending, pull all available pools, sorting them in descending order by warmupDay and lastSendDate
    • If the lastSendDate is not the calendar “Yesterday”, then the previous warmupDay’s sending volume will be repeated to avoid over-sending (this is days of warmup, not calendar days, which matters to ISPs) … e.g the pool is named warmup_5_20170101 and today’s date is 20170103 (2 days later), then based on the default resetDays value of 1 the day4 warmup will be performed and if completed, the date will be updated but not the warmupDay.
    • In the example above, if the customer configures resetDays to be 2 or greater then the warmup would continue as if the days were contiguous without repeating the previous warmupDay’s volume
  • Based on the “day” that is in the pool name, add the “user_warmup_pools(true)” function to your mailsend helper to allow the code to calculate how many emails should be sent using any available warmup pools.
    • The available warmup pools should be pulled daily and updated as they are no longer available for today’s sending. This will prevent the server from needing to request pools over and over.
    • If no warmup pools are found, then [NEED LOGIC HERE]
    • If you have the environment variable set for your current sending volume, the function will calculate how many emails to send to each IP
    • If you do not have this, please pass that daily max volume to this function
  • Sending emails from a pool
    • As emails are sent, the code will calculate and manage the correct amount of emails to send to the pool (# of IPs * warmup day’s sending limit per IP)
    • As each pool reaches it’s limit for the day, the warmup function will update the pool name and roll over to the next available pool based on the day and the date.
      • Pool name updates the warmupDay and the lastSendDate

Calculation: Today’s Volume for this pool

  • This calculation will look at all of the items that control the number of emails sent through each IP and set the number of emails to send through this pool. This will allow the pools to be rotated, as well as the IPs.
totalEmailsToSend = 50 * numIpsInThisPool

if warmupDay > 1
	growthRate = (currentDailyVolume / (totalEmailsToSend))^(1/totalDaysToWarmup)
	totalSend = (50 * growthRate) ^ (warmupDay - 1)

Examples:

Happy Path

Calendar Day 1 / WarmupDay 0 - 20170101

  • 3 IPs are purchased and added to warmup_1
  • Warmup is configured to max out at 50,000 emails per IP over 15 days

Calendar Day 2 / WarmupDay 1 - 20170102

  • All pools are requested and warmup_1 is returned
  • lastSendDate is not considered because warmup_1 is returned
  • Upon sending, each IP sends 50 emails
  • Once 150 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool name is updated to warmup_2_20170102

Calendar Day 3 / WarmupDay 2 - 20170103

  • All pools are requested and warmup_2_20170102 is returned
  • The lastSendDate is = 1 day old, follow warmupDay 2 rules
  • Upon sending, each IP sends 100 emails
  • Once 300 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool name is updated to warmup_3_20170103

Calendar Days 4-15 / warmupDays 3-14

  • Repeat process, following growth curve
  • The lastSendDate is = 1 day old, follow warmupDay ‘n’ rules

Calendar Day 16 / warmupDay 15 - 20170116

  • All pools are requested and warmup_15_20170103 is returned
  • The lastSendDate is = 1 day old, follow warmupDay 15 rules
  • Upon sending, each IP sends 50,000 emails
  • Once 150,000 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool warmup_15_20170103 is dissolved, as it is no longer needed.
  • Customer builds rules to handle IP assignment accordingly.

Date Skipping Path

Calendar Day 1 / warmupDay 0 - 20170205

  • 3 IPs are purchased and added to warmup_1
  • Warmup is configured to max out at 50,000 emails per IP over 15 days

Calendar Day 2 / warmupDay 1 - 20170206

  • All pools are requested and warmup_1 is returned
  • lastSendDate is not considered because warmup_1 is returned
  • Upon sending, each IP sends 50 emails
  • Once 150 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool name is updated to warmup_2_20170106

Calendar Day 3 / warmupDay N/A - 20170207

  • No Sending - Nothing happens, no updates are made, nothing changes

Calendary Day 4 / warmupDay 1 - 20170208

  • All pools are requested and warmup_2_20170106 is returned
  • The lastSendDate is > 1 days old, revert to warmup_1 rules (pool’s warmupDay minus 1 warmupDay)
  • Upon sending, each IP sends 50 emails
  • Once 150 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool name is updated to warmup_2_20170208

Calendar Day 5 / warmupDay 2 - 20170209

  • All pools are requested and warmup_2_20170108 is returned
  • The lastSendDate is = 1 day old, follow warmupDay 2 rules
  • Upon sending, each IP sends 100 emails
  • Once 300 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool name is updated to warmup_3_20170209

Day 15

  • All pools are requested and warmup_1 is returned
  • Upon sending, each IP sends 50,000 emails
  • Once 150,000 emails are sent, the pool name is no longer added to mailsend and regular sending is resumed
  • Pool is dissolved, as it is no longer needed.
  • Customer builds rules to handle IP assignment accordingly.

Acceptance Criteria

  • Tests should be generated to test the two paths taken above
  • The calculations for number of emails should have tests
  • The calculations for which day is "today" and which is "the day to be run" should have tests

Create a USE_CASES.md file

Issue Summary

Create this file and add a USE_CASE for an http-client and add examples of how to make RESTful method calls:

  • GET
  • POST
  • PATCH
  • PUT
  • DELETE

Hints:

  • You can use code from examples of this from the sendgrid-python library, as this is the client that library uses :)
  • The sendgrid-python library has a USE_CASES.md file that will give you a good framework to writing this file (please copy format, but not content from that document)

Hacktoberfest: SendGrid Current Status

SendGrid DX team current status:

  • Wow
  • OMG
  • THANK YOU

Hacktoberfest 2017 has completely blown us away. We have had over 900 pull requests from over 300 contributors all in the last 30 days. That is more PRs than we normally get in 2 years!
We are actively working to review, comment, and/or merge as many PRs as we possibly can as quickly as we can.

We are currently working on “intaking” all the PRs that have come in, oldest first (we have about 400 remaining to go through). We are making sure that each PR we review is one we have a chance of merging - there have been a couple spammy items that came through. Due to the massive influx of requests so far, @thinkingserious and @mbernier have been working nights and weekends all month just to keep up! We’re not even mad, this is amazing!

Hey, that’s great for you - but what about my shirt!

If you have signed the CLA before 11/1, but haven’t had a PR merged yet, do not despair! We know we are behind on even just commenting on every PR to show you that we received it (something we typically do). If you submitted a mergeable (non-spam, actually adds value to the project) PR during October 2017, we will grant access to this page to redeem your shirt, sticker, and hacker pin. Next year, we will be sure to communicate this information sooner. We are sorry for any confusion we have caused. We appreciate those of you who have reached out to find out what’s going on!

What can I do to help move things along?

Have you signed the CLA yet?
We can only merge items from contributors who signed the CLA

Can you help another contributor?
If you can identify potential problems, add suggestions, or even leave a comment with your review of another PR (Looks good to me! Or I approve this change), that would help us review those PRs much faster, making it easier to get to your PR.

Do you even write tests, friend?
If you see a place where we could have a test to validate a piece of functionality, add it in. We know We know! It’s just another PR we have to review and merge. You’re right, it is! However, the more tests we have, the earlier our CI tool can catch issues, saving us a review as well as back and forth time.

@casche, @emisanada, @flaredragon, @kencrocken, @krlevkirill, @mithunsasidharan, @mptap, @mslourens, @onefastsnail, @skshelar

Update .md files for SEO-ness

We received an awesome PR for #hacktoberfest on our ruby library
We would love to see the same thing on the README in this repo as well.
Please replace the "-" with "_" in README, CONTRIBUTING, USE_CASES, USAGE files.

Thanks and happy Hacktoberfest!!

Add esdoc support

Issue Summary

Creating local documentation can be super helpful

  1. Force a version of chai and install esdoc and coverage plugin
npm i [email protected] esdoc esdoc-coverage-plugin
  1. In the root dir, create .esdoc.json with the following:
{
    "source": "./lib",
    "destination": "./docs",
    "plugins": [
      {
        "name": "esdoc-coverage-plugin", 
        "option": {
          "enable": true,
          "kind": ["class", "method", "member", "get", "set", "constructor", "function", "variable"]
        }
      }
    ]
  }
  1. Update .gitignore by adding docs to the list of files to ignore
  2. Look at this PR and make the same changes to the files here in nodejs-http-client as were made to CONTRIBUTING and USAGE in sendgrid-nodejs

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.