From 368b1f0fbb49256f564eafa13d65f2dcb5e0ed6a Mon Sep 17 00:00:00 2001 From: Zadkiel Aslafy-Aharonian Date: Wed, 3 Oct 2018 16:41:01 +0200 Subject: [PATCH 01/35] fix(deps): Update to mailparser==^2.3.4 --- packages/inbound-mail-parser/package.json | 2 +- packages/inbound-mail-parser/yarn.lock | 261 +++++++++++++++++++--- 2 files changed, 230 insertions(+), 33 deletions(-) diff --git a/packages/inbound-mail-parser/package.json b/packages/inbound-mail-parser/package.json index 9f06fa3e3..e544bd461 100644 --- a/packages/inbound-mail-parser/package.json +++ b/packages/inbound-mail-parser/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@sendgrid/helpers": "^6.3.0", - "mailparser": "^0.6.1" + "mailparser": "^2.3.4" }, "tags": [ "sendgrid" diff --git a/packages/inbound-mail-parser/yarn.lock b/packages/inbound-mail-parser/yarn.lock index b256403d7..a4bcf996a 100644 --- a/packages/inbound-mail-parser/yarn.lock +++ b/packages/inbound-mail-parser/yarn.lock @@ -2,46 +2,243 @@ # yarn lockfile v1 -addressparser@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" +"@sendgrid/helpers@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@sendgrid/helpers/-/helpers-6.3.0.tgz#1b1798af22aa7a4c98257fab3dd2a6a6afd8b467" + dependencies: + chalk "^2.0.1" + deepmerge "^2.1.1" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +chalk@^2.0.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +deepmerge@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.0.tgz#17087b22e1dccf14310ec892e696269e85374b45" + +dom-serializer@0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + dependencies: + domelementtype "~1.1.1" + entities "~1.1.1" + +domelementtype@1, domelementtype@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + dependencies: + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + dependencies: + dom-serializer "0" + domelementtype "1" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + +he@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + +html-to-text@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/html-to-text/-/html-to-text-4.0.0.tgz#c1f4e100d74e9feab5b152d7b6b3be3c1c6412b0" + dependencies: + he "^1.0.0" + htmlparser2 "^3.9.2" + lodash "^4.17.4" + optimist "^0.6.1" -encoding@^0.1.12, encoding@~0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" +htmlparser2@^3.9.2: + version "3.9.2" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" dependencies: - iconv-lite "~0.4.13" + domelementtype "^1.3.0" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^2.0.2" -extend@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +iconv-lite@0.4.23: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +inherits@^2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -iconv-lite@~0.4.13: - version "0.4.17" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.17.tgz#4fdaa3b38acbc2c031b045d0edcdfe1ecab18c8d" +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -mailparser@^0.6.1: - version "0.6.2" - resolved "https://registry.yarnpkg.com/mailparser/-/mailparser-0.6.2.tgz#03c486039bdf4df6cd3b6adcaaac4107dfdbc068" +libbase64@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/libbase64/-/libbase64-1.0.3.tgz#de3023234abeefeb9d49378804c8a94404f5c98c" + +libmime@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/libmime/-/libmime-4.0.1.tgz#dc71a19bfa6a97f8249d7205251d862d6fc599fb" dependencies: - encoding "^0.1.12" - mime "^1.3.4" - mimelib "^0.3.0" - uue "^3.1.0" + iconv-lite "0.4.23" + libbase64 "1.0.3" + libqp "1.1.0" -mime@^1.3.4: - version "1.3.6" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.6.tgz#591d84d3653a6b0b4a3b9df8de5aa8108e72e5e0" +libqp@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/libqp/-/libqp-1.1.0.tgz#f5e6e06ad74b794fb5b5b66988bf728ef1dedbe8" -mimelib@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/mimelib/-/mimelib-0.3.0.tgz#4b16d4b435403daf692bc227890c7165ff3de894" +linkify-it@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-2.0.3.tgz#d94a4648f9b1c179d64fa97291268bdb6ce9434f" dependencies: - addressparser "~1.0.1" - encoding "~0.1.12" + uc.micro "^1.0.1" + +lodash@^4.17.4: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" -uue@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uue/-/uue-3.1.0.tgz#5d67d37030e66efebbb4b8aac46daf9b55befbf6" +mailparser@^2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/mailparser/-/mailparser-2.3.4.tgz#63895f3db56ab21d23713b4d3cfcc18911936497" dependencies: - extend "~3.0.0" + he "1.1.1" + html-to-text "4.0.0" + iconv-lite "0.4.24" + libmime "4.0.1" + linkify-it "2.0.3" + mailsplit "4.2.3" + nodemailer "4.6.8" + tlds "1.203.1" + +mailsplit@4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/mailsplit/-/mailsplit-4.2.3.tgz#4c8ba5c69322a39625ef424df7c715a51c6271a7" + dependencies: + libbase64 "1.0.3" + libmime "4.0.1" + libqp "1.1.0" + +minimist@~0.0.1: + version "0.0.10" + resolved "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + +nodemailer@4.6.8: + version "4.6.8" + resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-4.6.8.tgz#f82fb407828bf2e76d92acc34b823d83e774f89c" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + +readable-stream@^2.0.2: + version "2.3.6" + resolved "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + dependencies: + has-flag "^3.0.0" + +tlds@1.203.1: + version "1.203.1" + resolved "https://registry.yarnpkg.com/tlds/-/tlds-1.203.1.tgz#4dc9b02f53de3315bc98b80665e13de3edfc1dfc" + +uc.micro@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.5.tgz#0c65f15f815aa08b560a61ce8b4db7ffc3f45376" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" From ab147403ea613e16b2a6ed2eb6aaed2672615268 Mon Sep 17 00:00:00 2001 From: Zadkiel Aharonian Date: Fri, 5 Oct 2018 13:31:17 +0200 Subject: [PATCH 02/35] Update contact-importer to v6 --- packages/contact-importer/README.md | 2 - packages/contact-importer/package.json | 2 +- packages/contact-importer/src/importer.js | 29 +- .../contact-importer/src/importer.spec.js | 6 +- packages/contact-importer/yarn.lock | 393 +++++++++++++++--- 5 files changed, 366 insertions(+), 66 deletions(-) diff --git a/packages/contact-importer/README.md b/packages/contact-importer/README.md index 5d4f468c6..2f9d3d7ef 100644 --- a/packages/contact-importer/README.md +++ b/packages/contact-importer/README.md @@ -4,8 +4,6 @@ **This package is part of a monorepo, please see [this README](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md) for details.** -This package has yet to be updated to support v6.0.0 of the `sendgrid-nodejs` SDK. Currently, this package is a placeholder. Please use [this package](https://www.npmjs.com/package/sendgrid) until the upgrade. The related issue is located [here](https://github.com/sendgrid/sendgrid-nodejs/issues/427). - To be notified when this package is updated, please subscribe to email [notifications](https://dx.sendgrid.com/newsletter/nodejs) for releases and breaking changes. diff --git a/packages/contact-importer/package.json b/packages/contact-importer/package.json index 5df9e8ed5..618369313 100644 --- a/packages/contact-importer/package.json +++ b/packages/contact-importer/package.json @@ -31,7 +31,7 @@ "bottleneck": "^1.12.0", "debug": "^2.2.0", "lodash.chunk": "^4.2.0", - "sendgrid": "^5.2.3" + "@sendgrid/client": "^6.3.0" }, "tags": [ "sendgrid" diff --git a/packages/contact-importer/src/importer.js b/packages/contact-importer/src/importer.js index 5266e1c4e..71ac46bc2 100644 --- a/packages/contact-importer/src/importer.js +++ b/packages/contact-importer/src/importer.js @@ -69,22 +69,23 @@ class ContactImporter extends EventEmitter { * @param {Object} task Task to be processed (data in 'data' property) * @param {Function} callback Callback function. */ - _worker (task, callback) { + _worker(task, callback) { const context = task.owner; debug('processing batch (%s items)', task.data.length); context.throttle.submit(context._sendBatch, context, task.data, callback); } - _sendBatch (context, data, callback) { + _sendBatch(context, data, callback) { debug('sending batch (%s items)', data.length); - const request = context.sg.emptyRequest(); - request.method = 'POST'; - request.path = '/v3/contactdb/recipients'; - request.body = data; + const request = { + method: 'POST', + path: '/v3/contactdb/recipients', + body: data, + }; - context.sg.API(request) - .then((response) => { + context.sg.request(request) + .then(([response]) => { debug('got response: %o', response); setTimeout(() => { context.throttle.incrementReservoir(1); @@ -106,23 +107,25 @@ class ContactImporter extends EventEmitter { * @param {Object} error * @param {Object} result */ - _notify (error, result, batch) { + _notify(error, result, batch) { if (error) { return this.emit('error', error, batch); } return this.emit('success', result, batch); - }; + } /** * Sets up the queue object on this instance of ContactImporter */ - _setupQueue () { + _setupQueue() { // Create a queue that wil be used to send batches to the throttler. this.queue = queue(ensureAsync(this._worker)); // When the last batch is removed from the queue, add any incomplete batches. this.queue.empty = () => { - if (!this.pendingItems.length) return; + if (!this.pendingItems.length) { + return; + } debug('adding %s items from deferrd queue for processing', this.pendingItems.length); @@ -141,7 +144,7 @@ class ContactImporter extends EventEmitter { * * @param {Array} batch A batch to send to the queue. */ - _pushToQueue (batch) { + _pushToQueue(batch) { this.queue.push({ data: batch, owner: this, diff --git a/packages/contact-importer/src/importer.spec.js b/packages/contact-importer/src/importer.spec.js index 610db0aa2..b81b41645 100644 --- a/packages/contact-importer/src/importer.spec.js +++ b/packages/contact-importer/src/importer.spec.js @@ -1,14 +1,14 @@ -const sendgrid = require('sendgrid'); +const sendgrid = require('@sendgrid/client'); const ContactImporter = require('./importer'); describe('test_contact_importer', function() { beforeEach(function() { // Create a new SendGrid instance. const API_KEY = process.env.API_KEY; - const sg = sendgrid(API_KEY); + sendgrid.setApiKey(API_KEY); // Create a new importer with a batch size of 2. - this.contactImporter = new ContactImporter(sg, { + this.contactImporter = new ContactImporter(sendgrid, { batchSize: 2, }); // this.spy = sinon.spy(ContactImporter.prototype, '_sendBatch') diff --git a/packages/contact-importer/yarn.lock b/packages/contact-importer/yarn.lock index c4e825795..78d31062d 100644 --- a/packages/contact-importer/yarn.lock +++ b/packages/contact-importer/yarn.lock @@ -2,9 +2,72 @@ # yarn lockfile v1 -addressparser@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/addressparser/-/addressparser-1.0.1.tgz#47afbe1a2a9262191db6838e4fd1d39b40821746" +"@sendgrid/client@^6.3.1": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@sendgrid/client/-/client-6.3.0.tgz#25c34b11bec392ab43ca7e52fb35e4105fb00901" + dependencies: + "@sendgrid/helpers" "^6.3.0" + "@types/request" "^2.0.3" + request "^2.81.0" + +"@sendgrid/helpers@^6.3.0": + version "6.3.0" + resolved "https://registry.yarnpkg.com/@sendgrid/helpers/-/helpers-6.3.0.tgz#1b1798af22aa7a4c98257fab3dd2a6a6afd8b467" + dependencies: + chalk "^2.0.1" + deepmerge "^2.1.1" + +"@types/caseless@*": + version "0.12.1" + resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.1.tgz#9794c69c8385d0192acc471a540d1f8e0d16218a" + +"@types/form-data@*": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e" + dependencies: + "@types/node" "*" + +"@types/node@*": + version "10.11.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.11.4.tgz#e8bd933c3f78795d580ae41d86590bfc1f4f389d" + +"@types/request@^2.0.3": + version "2.47.1" + resolved "https://registry.yarnpkg.com/@types/request/-/request-2.47.1.tgz#25410d3afbdac04c91a94ad9efc9824100735824" + dependencies: + "@types/caseless" "*" + "@types/form-data" "*" + "@types/node" "*" + "@types/tough-cookie" "*" + +"@types/tough-cookie@*": + version "2.3.3" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.3.tgz#7f226d67d654ec9070e755f46daebf014628e9d9" + +ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" async.ensureasync@^0.5.2: version "0.5.2" @@ -64,76 +127,312 @@ async.util.setimmediate@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/async.util.setimmediate/-/async.util.setimmediate-0.5.2.tgz#2812ebabf2a58027758d4bc7793d1ccfaf10255f" +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + dependencies: + tweetnacl "^0.14.3" + bottleneck@^1.12.0: version "1.15.1" resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-1.15.1.tgz#fa9fec163e01b7a6c426b87e603e656025ff0145" +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + +chalk@^2.0.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +combined-stream@1.0.6: + version "1.0.6" + resolved "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" + dependencies: + delayed-stream "~1.0.0" + +combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + dependencies: + delayed-stream "~1.0.0" + +core-util-is@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + dependencies: + assert-plus "^1.0.0" + debug@^2.2.0: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: ms "2.0.0" -encoding@^0.1.12, encoding@~0.1.12: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" +deepmerge@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" dependencies: - iconv-lite "~0.4.13" + jsbn "~0.1.0" + safer-buffer "^2.1.0" -extend@~3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -iconv-lite@~0.4.13: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" -lodash.chunk@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" -mailparser@^0.6.1: - version "0.6.2" - resolved "https://registry.yarnpkg.com/mailparser/-/mailparser-0.6.2.tgz#03c486039bdf4df6cd3b6adcaaac4107dfdbc068" +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: - encoding "^0.1.12" - mime "^1.3.4" - mimelib "^0.3.0" - uue "^3.1.0" + asynckit "^0.4.0" + combined-stream "1.0.6" + mime-types "^2.1.12" -mime@^1.3.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + dependencies: + assert-plus "^1.0.0" -mimelib@^0.3.0: +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + +har-validator@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.0.tgz#44657f5688a22cfd4b72486e81b3a3fb11742c29" + dependencies: + ajv "^5.3.0" + har-schema "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + +json-schema-traverse@^0.3.0: version "0.3.1" - resolved "https://registry.yarnpkg.com/mimelib/-/mimelib-0.3.1.tgz#787add2415d827acb3af6ec4bca1ea9596418853" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" dependencies: - addressparser "~1.0.1" - encoding "~0.1.12" + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +lodash.chunk@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" + +mime-db@~1.36.0: + version "1.36.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.20" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" + dependencies: + mime-db "~1.36.0" ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -sendgrid-rest@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/sendgrid-rest/-/sendgrid-rest-2.4.0.tgz#88e11a86375ec0e14b5faf1b4a0a191639ce90ef" +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + +psl@^1.1.24: + version "1.1.29" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + +request@^2.81.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +safe-buffer@^5.0.1, safe-buffer@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +sshpk@^1.7.0: + version "1.14.2" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.2.tgz#c6fc61648a3d9c4e764fd3fcdf4ea105e492ba98" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + safer-buffer "^2.0.2" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + dependencies: + has-flag "^3.0.0" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + dependencies: + psl "^1.1.24" + punycode "^1.4.1" -sendgrid@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/sendgrid/-/sendgrid-5.2.3.tgz#37cd28ddd93fca2d3fa7dda10a323b1f43ffecfc" +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" dependencies: - async.ensureasync "^0.5.2" - async.queue "^0.5.2" - bottleneck "^1.12.0" - debug "^2.2.0" - lodash.chunk "^4.2.0" - mailparser "^0.6.1" - sendgrid-rest "^2.3.0" + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" -uue@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/uue/-/uue-3.1.0.tgz#5d67d37030e66efebbb4b8aac46daf9b55befbf6" +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" dependencies: - extend "~3.0.0" + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" From 673c600cb8d8f3947dfd753f6872a574c13960da Mon Sep 17 00:00:00 2001 From: Zadkiel Aharonian Date: Fri, 5 Oct 2018 13:42:57 +0200 Subject: [PATCH 03/35] Update dependencies --- packages/contact-importer/package.json | 6 +++--- packages/contact-importer/yarn.lock | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/contact-importer/package.json b/packages/contact-importer/package.json index 618369313..09ffb1000 100644 --- a/packages/contact-importer/package.json +++ b/packages/contact-importer/package.json @@ -26,12 +26,12 @@ "access": "public" }, "dependencies": { + "@sendgrid/client": "^6.3.0", "async.ensureasync": "^0.5.2", "async.queue": "^0.5.2", "bottleneck": "^1.12.0", - "debug": "^2.2.0", - "lodash.chunk": "^4.2.0", - "@sendgrid/client": "^6.3.0" + "debug": "^4.0.1", + "lodash.chunk": "^4.2.0" }, "tags": [ "sendgrid" diff --git a/packages/contact-importer/yarn.lock b/packages/contact-importer/yarn.lock index 78d31062d..554c41881 100644 --- a/packages/contact-importer/yarn.lock +++ b/packages/contact-importer/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@sendgrid/client@^6.3.1": +"@sendgrid/client@^6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@sendgrid/client/-/client-6.3.0.tgz#25c34b11bec392ab43ca7e52fb35e4105fb00901" dependencies: @@ -197,11 +197,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@^2.2.0: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" +debug@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.0.1.tgz#f9bb36d439b8d1f0dd52d8fb6b46e4ebb8c1cd5b" dependencies: - ms "2.0.0" + ms "^2.1.1" deepmerge@^2.1.1: version "2.2.1" @@ -330,9 +330,9 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "~1.36.0" -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" oauth-sign@~0.9.0: version "0.9.0" From 7f85fbfbafcf9371cd027b79aadd7d60eaf630c2 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 11:00:42 -0400 Subject: [PATCH 04/35] update grammer in pull_request_template.md --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ba377ae70..e1e25bc8c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,7 +15,7 @@ Closes #2 - [ ] I updated my branch with the master branch. - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added necessary documentation about the functionality in the appropriate .md file -- [ ] I have added in line documentation to the code I modified +- [ ] I have added inline documentation to the code I modified ### Short description of what this PR does: - From 712d66f93f1a81b82fe556ea709e3392be11df07 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 11:42:11 -0400 Subject: [PATCH 05/35] run README.md through grammerly and update --- packages/client/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/README.md b/packages/client/README.md index 2fe2cd9f6..ed8588458 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -22,7 +22,7 @@ Grab your API Key from the [SendGrid UI](https://app.sendgrid.com/settings/api_k ## Setup Environment Variables -Do not hard code your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys) into your code. Instead, use an environment variable or some other secure means of protecting your SendGrid API Key. Following is an example of using an environment variable. +Do not hardcode your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys) into your code. Instead, use an environment variable or some other secure means of protecting your SendGrid API Key. Following is an example of using an environment variable. Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example: @@ -34,7 +34,7 @@ source ./sendgrid.env ## Install Package -The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it. +The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it. ```sh npm install --save @sendgrid/client From bd2987bacec40a6504b8bb5db8045fbe511ba6e7 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 12:35:11 -0400 Subject: [PATCH 06/35] run USAGE.md through grammerly and update --- packages/client/USAGE.md | 234 +++++++++++++++++++-------------------- 1 file changed, 117 insertions(+), 117 deletions(-) diff --git a/packages/client/USAGE.md b/packages/client/USAGE.md index 852842ac8..e7574bae5 100644 --- a/packages/client/USAGE.md +++ b/packages/client/USAGE.md @@ -44,7 +44,7 @@ client.setApiKey(process.env.SENDGRID_API_KEY); **This endpoint allows you to retrieve a list of all of the IP addresses that recently attempted to access your account either through the User Interface or the API.** -IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account. +IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your IP address from the whitelist, thus preventing yourself from accessing your account. For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html). @@ -70,7 +70,7 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ When adding an IP to your whitelist, include the IP address in an array. You can whitelist one IP at a time, or you can whitelist multiple IPs at once. -IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account. +IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your IP address from the whitelist, thus preventing yourself from accessing your account. For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html). @@ -106,7 +106,7 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ You can remove one IP at a time, or you can remove multiple IP addresses. -IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account. +IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your IP address from the whitelist, thus preventing yourself from accessing your account. For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html). @@ -134,7 +134,7 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ **This endpoint allows you to retrieve a list of IP addresses that are currently whitelisted.** -IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account. +IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your IP address from the whitelist, thus preventing yourself from accessing your account. For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html). @@ -156,7 +156,7 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ When removing a specific IP address from your whitelist, you must include the ID in your call. -IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account. +IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your IP address from the whitelist, thus preventing yourself from accessing your account. For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html). @@ -180,7 +180,7 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ You must include the ID for the specific IP address you want to retrieve in your call. -IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your own IP address from the whitelist, thus preventing yourself from accessing your account. +IP Access Management allows you to control which IP addresses can be used to access your account, either through the User Interface or the API. There is no limit to the number of IP addresses that you can add to your whitelist. It is possible to remove your IP address from the whitelist, thus preventing yourself from accessing your account. For more information, please see our [User Guide](http://sendgrid.com/docs/User_Guide/Settings/ip_access_management.html). @@ -203,7 +203,7 @@ For more information, please see our [User Guide](http://sendgrid.com/docs/User_ **This endpoint allows you to create a new alert.** -Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. There are two types of alerts that can be created with this endpoint: +Alerts allow you to specify an email address to receive notifications regarding your email usage or statistics. There are two types of alerts available with this endpoint: * `usage_limit` allows you to set the threshold at which an alert will be sent. * `stats_notification` allows you to set how frequently you would like to receive email statistics reports. For example, "daily", "weekly", or "monthly". @@ -329,7 +329,7 @@ For more information about alerts, please see our [User Guide](https://sendgrid. **This endpoint allows you to create a new random API Key for the user.** -A JSON request body containing a "name" property is required. If number of maximum keys is reached, HTTP 403 will be returned. +A JSON request body containing a "name" property is required. If the number of maximum keys is reached, HTTP 403 will be returned. There is a limit of 100 API Keys on your account. @@ -386,7 +386,7 @@ The API Keys feature allows customers to be able to generate an API Key credenti **This endpoint allows you to update the name and scopes of a given API key.** A JSON request body with a "name" property is required. -Most provide the list of all the scopes an api key should have. +Most provide the list of all the scopes an API key should have. The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). @@ -444,7 +444,7 @@ The API Keys feature allows customers to be able to generate an API Key credenti **This endpoint allows you to revoke an existing API Key** -Authentications using this API Key will fail after this request is made, with some small propagation delay.If the API Key ID does not exist an HTTP 404 will be returned. +Authentications using this API Key will fail after this request is made, with some small propagation delay. If the API Key ID does not exist an HTTP 404 will be returned. The API Keys feature allows customers to be able to generate an API Key credential which can be used for authentication with the SendGrid v3 Web API or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). @@ -470,7 +470,7 @@ The API Keys feature allows customers to be able to generate an API Key credenti ``` ## Retrieve an existing API Key -**This endpoint allows you to retrieve a single api key.** +**This endpoint allows you to retrieve a single API key.** If the API Key ID does not exist an HTTP 404 will be returned. @@ -493,7 +493,7 @@ If the API Key ID does not exist an HTTP 404 will be returned. **This endpoint allows you to create a new suppression group.** -Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. +Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example Daily Newsletters, Invoices, System Alerts. The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. @@ -521,7 +521,7 @@ Each user can create up to 25 different suppression groups. **This endpoint allows you to retrieve information about multiple suppression groups.** -This endpoint will return information for each group ID that you include in your request. To add a group ID to your request, simply append `&id=` followed by the group ID. +This endpoint will return information for each group ID that you include in your request. To add a group ID to your request, just append `&id=` followed by the group ID. Suppressions are a list of email addresses that will not receive content sent under a given [group](https://sendgrid.com/docs/API_Reference/Web_API_v3/Suppression_Management/groups.html). @@ -549,7 +549,7 @@ Suppression groups, or [unsubscribe groups](https://sendgrid.com/docs/API_Refere You can only delete groups that have not been attached to sent mail in the last 60 days. If a recipient uses the "one-click unsubscribe" option on an email associated with a deleted group, that recipient will be added to the global suppression list. -Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. +Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example Daily Newsletters, Invoices, System Alerts. The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. @@ -573,7 +573,7 @@ Each user can create up to 25 different suppression groups. **This endpoint allows you to update or change a suppression group.** -Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. +Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example Daily Newsletters, Invoices, System Alerts. The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. @@ -601,7 +601,7 @@ Each user can create up to 25 different suppression groups. **This endpoint allows you to retrieve a single suppression group.** -Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example: Daily Newsletters, Invoices, System Alerts. +Suppression groups, or unsubscribe groups, are specific types or categories of email that you would like your recipients to be able to unsubscribe from. For example Daily Newsletters, Invoices, System Alerts. The **name** and **description** of the unsubscribe group will be visible by recipients when they are managing their subscriptions. @@ -816,7 +816,7 @@ Suppressions are a list of email addresses that will not receive content sent un # BROWSERS -## Retrieve email statistics by browser. +## Retrieve email statistics from a browser. **This endpoint allows you to retrieve your email statistics segmented by browser type.** @@ -854,7 +854,7 @@ Advanced Stats provide a more in-depth view of your email statistics and the act Our Marketing Campaigns API lets you create, manage, send, and schedule campaigns. -Note: In order to send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both html and plain text), and at least one list or segment ID. This information is not required when you create a campaign. +Note: To send or schedule the campaign, you will be required to provide a subject, sender ID, content (we suggest both HTML and Plain Text), and at least one list or segment ID. This information is not required when you create a campaign. For more information: @@ -1095,7 +1095,7 @@ For more information: **This endpoint allows you to immediately send a campaign at the time you make the API call.** -Normally a POST would have a request body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed. +Usually, a POST would have a request body, but since this endpoint is telling us to send a resource that is already created, a request body is not needed. For more information: @@ -1148,7 +1148,7 @@ For more information: **This endpoint allows you to retrieve a list of all of your categories.** -Categories can help organize your email analytics by enabling you to tag emails by type or broad topic. You can define your own custom categories. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). +Categories can help organize your email analytics by enabling you to tag emails by type or broad topic. You can define your custom categories. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). ### GET /categories @@ -1174,7 +1174,7 @@ Categories can help organize your email analytics by enabling you to tag emails If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. -Categories allow you to group your emails together according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). +Categories allow you to group your emails according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). ### GET /categories/stats @@ -1203,7 +1203,7 @@ Categories allow you to group your emails together according to broad topics tha If you do not define any query parameters, this endpoint will return a sum for each category in groups of 10. -Categories allow you to group your emails together according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). +Categories allow you to group your emails according to broad topics that you define. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/categories.html). ### GET /categories/stats/sums @@ -1639,7 +1639,7 @@ The Contacts API helps you manage your [Marketing Campaigns](https://sendgrid.co ``` ## Delete Recipient -**This endpoint allows you to deletes one or more recipients.** +**This endpoint allows you to delete one or more recipients.** The body of an API call to this endpoint must include an array of recipient IDs of the recipients you want to delete. @@ -1763,7 +1763,7 @@ The contactdb is a database of your contacts for [SendGrid Marketing Campaigns]( field_name: * is a variable that is substituted for your actual custom field name from your recipient. -* Text fields must be url-encoded. Date fields are searchable only by unix timestamp (e.g. 2/2/2015 becomes 1422835200) +* Text fields must be URL encoded. Date fields are searchable only by Unix timestamp (e.g. 2/2/2015 becomes 1422835200) * If field_name is a 'reserved' date field, such as created_at or updated_at, the system will internally convert your epoch time to a date range encompassing the entire day. For example, an epoch time of 1422835600 converts to Mon, 02 Feb 2015 00:06:40 GMT, but internally the system will search from Mon, 02 Feb 2015 00:00:00 GMT through @@ -1871,8 +1871,8 @@ All recipients in your contactdb will be added or removed automatically dependin List Id: -* Send this to segment from an existing list -* Don't send this in order to segment from your entire contactdb. +* Send this to segment from an existing list. +* Don't send this to segment from your entire contactdb. Valid operators for create and update depend on the type of the field you are segmenting: @@ -1948,7 +1948,7 @@ For more information about segments in Marketing Campaigns, please see our [User ``` ## Delete a segment -**This endpoint allows you to delete a segment from your recipients database.** +**This endpoint allows you to delete a segment from your recipients' database.** You also have the option to delete all the contacts from your Marketing Campaigns recipient database who were in this segment. @@ -2088,10 +2088,10 @@ For more information about segments in Marketing Campaigns, please see our [User ## Available Device Types | **Device** | **Description** | **Example** | |---|---|---| -| Desktop | Email software on desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | +| Desktop | Email software on a desktop computer. | I.E., Outlook, Sparrow, or Apple Mail. | | Webmail | A web-based email client. | I.E., Yahoo, Google, AOL, or Outlook.com. | -| Phone | A smart phone. | iPhone, Android, Blackberry, etc. -| Tablet | A tablet computer. | iPad, android based tablet, etc. | +| Phone | A smartphone. | iPhone, Android, Blackberry, etc. +| Tablet | A tablet computer. | iPad, Android-based tablet, etc. | | Other | An unrecognized device. | Advanced Stats provide a more in-depth view of your email statistics and the actions taken by your recipients. You can segment these statistics by geographic location, device type, client type, browser, and mailbox provider. For more information about statistics, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Statistics/index.html). @@ -2181,9 +2181,9 @@ This endpoint is for adding a(n) IP Address(es) to your account. **This endpoint allows you to retrieve a list of all assigned and unassigned IPs.** -Response includes warm up status, pools, assigned subusers, and whitelabel info. The start_date field corresponds to when warmup started for that IP. +The response includes warm-up status, pools, assigned subusers, and whitelabel info. The start_date field corresponds to when warmup started for that IP. -A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +A single IP address or a range of IP addresses may be dedicated to an account to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. ### GET /ips @@ -2210,7 +2210,7 @@ A single IP address or a range of IP addresses may be dedicated to an account in **This endpoint allows you to retrieve only assigned IP addresses.** -A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +A single IP address or a range of IP addresses may be dedicated to an account to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. ### GET /ips/assigned @@ -2230,7 +2230,7 @@ A single IP address or a range of IP addresses may be dedicated to an account in **Each user can create up to 10 different IP pools.** -IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. +IP Pools allow you to group your dedicated SendGrid IP addresses. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. IP pools can only be used with whitelabeled IP addresses. @@ -2256,7 +2256,7 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu **This endpoint allows you to retrieve all of your IP pools.** -IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. +IP Pools allow you to group your dedicated SendGrid IP addresses. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. IP pools can only be used with whitelabeled IP addresses. @@ -2278,7 +2278,7 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu **This endpoint allows you to update the name of an IP pool.** -IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. +IP Pools allow you to group your dedicated SendGrid IP addresses. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. IP pools can only be used with whitelabeled IP addresses. @@ -2304,7 +2304,7 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu **This endpoint allows you to delete an IP pool.** -IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. +IP Pools allow you to group your dedicated SendGrid IP addresses. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. IP pools can only be used with whitelabeled IP addresses. @@ -2328,7 +2328,7 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu **This endpoint allows you to list all of the IP addresses that are in a specific IP pool.** -IP Pools allow you to group your dedicated SendGrid IP addresses together. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. +IP Pools allow you to group your dedicated SendGrid IP addresses. For example, you could create separate pools for your transactional and marketing email. When sending marketing emails, specify that you want to use the marketing IP pool. This allows you to maintain separate reputations for your different email traffic. IP pools can only be used with whitelabeled IP addresses. @@ -2352,7 +2352,7 @@ If an IP pool is NOT specified for an email, it will use any IP available, inclu You can add the same IP address to multiple pools. It may take up to 60 seconds for your IP address to be added to a pool after your request is made. -A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +A single IP address or a range of IP addresses may be dedicated to an account to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. ### POST /ips/pools/{pool_name}/ips @@ -2376,7 +2376,7 @@ A single IP address or a range of IP addresses may be dedicated to an account in The same IP address can be added to multiple IP pools. -A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +A single IP address or a range of IP addresses may be dedicated to an account to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. ### DELETE /ips/pools/{pool_name}/ips/{ip} @@ -2394,7 +2394,7 @@ A single IP address or a range of IP addresses may be dedicated to an account in ``` ## Get remaining IPs count -This endpoint gets amount of IP Addresses that can still be created during a given period and the price of those IPs. +This endpoint gets the amount of IP Addresses that can still be created during a given period and the price of those IPs. ### GET /ips/remaining @@ -2500,7 +2500,7 @@ For more general information about warming up IPs, please see our [Classroom](ht The same IP address can be added to multiple IP pools. -A single IP address or a range of IP addresses may be dedicated to an account in order to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. +A single IP address or a range of IP addresses may be dedicated to an account to send email for multiple domains. The reputation of this IP is based on the aggregate performance of all the senders who use it. ### GET /ips/{ip_address} @@ -2521,7 +2521,7 @@ A single IP address or a range of IP addresses may be dedicated to an account in **This endpoint allows you to generate a new batch ID. This batch ID can be associated with scheduled sends via the mail/send endpoint.** -If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at anytime up to 10 minutes before the schedule date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint. +If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at any time up to 10 minutes before the scheduled date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint. More Information: @@ -2545,7 +2545,7 @@ More Information: **This endpoint allows you to validate a batch ID.** -If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at anytime up to 10 minutes before the schedule date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint. +If you set the SMTPAPI header `batch_id`, it allows you to then associate multiple scheduled mail/send requests together with the same ID. Then at any time up to 10 minutes before the scheduled date, you can cancel all of the mail/send requests that have this batch ID by calling the Cancel Scheduled Send endpoint. More Information: @@ -2565,7 +2565,7 @@ More Information: ``` ## v3 Mail Send -This endpoint allows you to send email over SendGrids v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). +This endpoint allows you to send an email over SendGrids v3 Web API, the most recent version of our API. If you are looking for documentation about the v2 Mail Send endpoint, please see our [v2 API Reference](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). * Top level parameters are referred to as "global". * Individual fields within the personalizations array will override any other global, or message level, parameters that are defined outside of personalizations. @@ -2695,7 +2695,7 @@ Mail settings allow you to tell SendGrid specific things to do to every email th **This endpoint allows you to update your current BCC mail settings.** -When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules. +When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules. Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html). @@ -2720,7 +2720,7 @@ Mail settings allow you to tell SendGrid specific things to do to every email th **This endpoint allows you to retrieve your current BCC mail settings.** -When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field, if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules. +When the BCC mail setting is enabled, SendGrid will automatically send a blind carbon copy (BCC) to an address for every email sent without adding that address to the header. Please note that only one email address may be entered in this field if you wish to distribute BCCs to multiple addresses you will need to create a distribution group or use forwarding rules. Mail settings allow you to tell SendGrid specific things to do to every email that you send to your recipients over SendGrids [Web API](https://sendgrid.com/docs/API_Reference/Web_API/mail.html) or [SMTP Relay](https://sendgrid.com/docs/API_Reference/SMTP_API/index.html). @@ -3168,7 +3168,7 @@ By integrating with New Relic, you can send your SendGrid email statistics to yo **This endpoint returns a list of all scopes that this user has access to.** -API Keys can be used to authenticate the use of [SendGrids v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned certain permissions, or scopes, that limit which API endpoints they are able to access. For a more detailed explanation of how you can use API Key permissions, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html). +API Keys can be used to authenticate the use of [SendGrids v3 Web API](https://sendgrid.com/docs/API_Reference/Web_API_v3/index.html), or the [Mail API Endpoint](https://sendgrid.com/docs/API_Reference/Web_API/mail.html). API Keys may be assigned specific permissions, or scopes, that limit which API endpoints they can access. For a more detailed explanation of how you can use API Key permissions, please visit our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/api_keys.html#-API-Key-Permissions) or [Classroom](https://sendgrid.com/docs/Classroom/Basics/API/api_key_permissions.html). ### GET /scopes @@ -3256,7 +3256,7 @@ This endpoint allows you to approve an access attempt. *You may create up to 100 unique sender identities.* -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. ### POST /senders @@ -3292,7 +3292,7 @@ Sender Identities are required to be verified before use. If your domain has bee **This endpoint allows you to retrieve a list of all sender identities that have been created for your account.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. ### GET /senders @@ -3310,7 +3310,7 @@ Sender Identities are required to be verified before use. If your domain has bee **This endpoint allows you to retrieve a specific sender identity.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. ### GET /senders/{sender_id} @@ -3328,7 +3328,7 @@ Sender Identities are required to be verified before use. If your domain has bee **This endpoint allows you to delete one of your sender identities.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. ### DELETE /senders/{sender_id} @@ -3348,7 +3348,7 @@ Sender Identities are required to be verified before use. If your domain has bee **This endpoint allows you to update a sender identity.** -Updates to `from.email` require re-verification. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Updates to `from.email` require re-verification. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. Partial updates are allowed, but fields that are marked as "required" in the POST (create) endpoint must not be nil if that field is included in the PATCH request. @@ -3386,7 +3386,7 @@ Partial updates are allowed, but fields that are marked as "required" in the POS **This endpoint allows you to resend a sender identity verification email.** -Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise an email will be sent to the `from.email`. +Sender Identities are required to be verified before use. If your domain has been whitelabeled it will auto verify on creation. Otherwise, an email will be sent to the `from.email`. ### POST /senders/{sender_id}/resend_verification @@ -3409,7 +3409,7 @@ Sender Identities are required to be verified before use. If your domain has bee **This endpoint allows you to retrieve all of your global email statistics between a given date range.** -Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. +Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their stats. ### GET /stats @@ -3494,7 +3494,7 @@ For more information about Subusers: ``` ## Retrieve Subuser Reputations -Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other negative action happens on a sent email, it will effect your sender rating. +Subuser sender reputations give a good idea how well a sender is doing with regards to how recipients and recipient servers react to the mail that is being received. When a bounce, spam report, or other adverse action happens on a sent email, it will affect your sender rating. This endpoint allows you to request the reputations for your subusers. @@ -3800,7 +3800,7 @@ There are two options for deleting blocked emails: 1. You can delete all blocked emails by setting `delete_all` to true in the request body. 2. You can delete some blocked emails by specifying the email addresses in an array in the request body. -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if a filter flags the message content on the receiving server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). @@ -3855,7 +3855,7 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User **This endpoint allows you to delete a specific email address from your blocks list.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if a filter flags the message content on the receiving server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). @@ -3877,7 +3877,7 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User **This endpoint allows you to retrieve a specific email address from your blocks list.** -[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if the message content is flagged by a filter on the receiving server. +[Blocks](https://sendgrid.com/docs/Glossary/blocks.html) happen when your message was rejected for a reason related to the message, not the recipient address. This can happen when your mail server IP address has been added to a blacklist or blocked by an ISP, or if a filter flags the message content on the receiving server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/blocks.html). @@ -3959,7 +3959,7 @@ For more information see: **This endpoint allows you to remove an email address from your bounce list.** -A bounced email is when the message is undeliverable and then returned to the server that sent it. This endpoint allows you to delete a single email addresses from your bounce list. +A bounced email is when the message is undeliverable and then returned to the server that sent it. This endpoint allows you to delete a single email address from your bounce list. For more information see: @@ -4016,11 +4016,11 @@ For more information see: There are two options for deleting invalid email addresses: 1) You can delete all invalid email addresses by setting `delete_all` to true in the request body. -2) You can delete some invalid email addresses by specifying certain addresses in an array in the request body. +2) You can delete some invalid email addresses by specifying the addresses in an array in the request body. -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients' mail server. -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our server or the recipient mail server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). @@ -4048,9 +4048,9 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User **This endpoint allows you to retrieve a list of all invalid email addresses.** -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients' mail server. -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our server or the recipient mail server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). @@ -4077,9 +4077,9 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User **This endpoint allows you to remove a specific email address from the invalid email address list.** -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients' mail server. -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our server or the recipient mail server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). @@ -4099,11 +4099,11 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User ``` ## Retrieve a specific invalid email -**This endpoint allows you to retrieve a specific invalid email addresses.** +**This endpoint allows you to retrieve a specific invalid email address.** -An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients mail server. +An invalid email occurs when you attempt to send email to an address that is formatted in a manner that does not meet internet email format standards or the email does not exist at the recipients' mail server. -Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our own server or the recipient mail server. +Examples include addresses without the @ sign or addresses that include certain special characters and/or spaces. This response can come from our server or the recipient mail server. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/invalid_emails.html). @@ -4223,7 +4223,7 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/User ``` ## Retrieve all global suppressions -**This endpoint allows you to retrieve a list of all email address that are globally suppressed.** +**This endpoint allows you to retrieve a list of all email addresses that are globally suppressed.** A global suppression (or global unsubscribe) is an email address of a recipient who does not want to receive any of your messages. A globally suppressed recipient will be removed from any email you send. For more information, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Suppressions/global_unsubscribes.html). @@ -4381,11 +4381,11 @@ This endpoint allows you to delete a teammate. ``` ## Update teammate's permissions -This endpoint allows you to update a teammates permissions. +This endpoint allows you to update a teammate's permissions. To turn a teammate into an admin, the request body should contain an `is_admin` set to `true`. Otherwise, set `is_admin` to `false` and pass in all the scopes that a teammate should have. -**Only the parent user or other admin teammates can update another teammates permissions.** +**Only the parent user or other admin teammates can update another teammate's permissions.** **Admin users can only update permissions.** @@ -4434,7 +4434,7 @@ This endpoint allows you to retrieve a specific teammate by username. Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +Transactional templates are templates explicitly created for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). ### POST /templates @@ -4458,7 +4458,7 @@ Transactional templates are templates created specifically for transactional ema Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +Transactional templates are templates explicitly created for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). ### GET /templates @@ -4478,7 +4478,7 @@ Transactional templates are templates created specifically for transactional ema Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +Transactional templates are templates explicitly created for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). ### DELETE /templates/{template_id} @@ -4500,7 +4500,7 @@ Transactional templates are templates created specifically for transactional ema Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +Transactional templates are templates explicitly created for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). ### PATCH /templates/{template_id} @@ -4524,7 +4524,7 @@ Transactional templates are templates created specifically for transactional ema Each user can create up to 300 different transactional templates. Transactional templates are specific to accounts and subusers. Templates created on a parent account will not be accessible from the subuser accounts. -Transactional templates are templates created specifically for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). +Transactional templates are templates explicitly created for transactional email and are not to be confused with [Marketing Campaigns templates](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/templates.html). For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). ### GET /templates/{template_id} @@ -4542,7 +4542,7 @@ Transactional templates are templates created specifically for transactional ema **This endpoint allows you to create a new version of a template.** -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +Each transactional template can have multiple versions, each version with unique subject and content. Each user can have up to 300 versions across all templates. For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). @@ -4571,7 +4571,7 @@ For more information about transactional templates, please see our [User Guide]( **This endpoint allows you to delete one of your transactional template versions.** -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +Each transactional template can have multiple versions, each version with unique subject and content. Each user can have up to 300 versions across all templates. For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). @@ -4599,7 +4599,7 @@ For more information about transactional templates, please see our [User Guide]( **This endpoint allows you to edit a version of one of your transactional templates.** -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +Each transactional template can have multiple versions, each version with unique subject and content. Each user can have up to 300 versions across all templates. For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). @@ -4633,7 +4633,7 @@ For more information about transactional templates, please see our [User Guide]( **This endpoint allows you to retrieve a specific version of a template.** -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +Each transactional template can have multiple versions, each version with unique subject and content. Each user can have up to 300 versions across all templates. For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). @@ -4659,7 +4659,7 @@ For more information about transactional templates, please see our [User Guide]( **This endpoint allows you to activate a version of one of your templates.** -Each transactional template can have multiple versions, each version with its own subject and content. Each user can have up to 300 versions across across all templates. +Each transactional template can have multiple versions, each version with unique subject and content. Each user can have up to 300 versions across all templates. For more information about transactional templates, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). @@ -4817,7 +4817,7 @@ For more information about tracking, please see our [User Guide](https://sendgri **This endpoint allows you to update your current settings for open tracking.** -Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and reported by the Event Webhook. You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. @@ -4843,7 +4843,7 @@ For more information about tracking, please see our [User Guide](https://sendgri **This endpoint allows you to retrieve your current settings for open tracking.** -Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and are reported by the Event Webhook. +Open Tracking adds an invisible image at the end of the email which can track email opens. If the email recipient has images enabled on their email client, a request to SendGrids server for the invisible image is executed and an open event is logged. These events are logged in the Statistics portal, Email Activity interface, and reported by the Event Webhook. You can track a variety of the actions your recipients may take when interacting with your emails including opening your emails, clicking on links in your emails, and subscribing to (or unsubscribing from) your emails. @@ -4923,7 +4923,7 @@ For more information about tracking, please see our [User Guide](https://sendgri Your user's account information includes the user's account type and reputation. -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -4963,7 +4963,7 @@ Your monthly credit allotment limits the number of emails you may send before in **This endpoint allows you to update the email address currently on file for your account.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -4989,7 +4989,7 @@ For more information about your user profile: **This endpoint allows you to retrieve the email address currently on file for your account.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -5011,7 +5011,7 @@ For more information about your user profile: **This endpoint allows you to update your password.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -5038,7 +5038,7 @@ For more information about your user profile: **This endpoint allows you to update your current profile details.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -5066,7 +5066,7 @@ It should be noted that any one or more of the parameters can be updated via the ``` ## Get a user's profile -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -5091,7 +5091,7 @@ For more information about your user profile: If the maximum number of cancellations/pauses are added, HTTP 400 will be returned. -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled. ### POST /user/scheduled_sends @@ -5114,7 +5114,7 @@ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled sen **This endpoint allows you to retrieve all cancel/paused scheduled send information.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled. ### GET /user/scheduled_sends @@ -5132,7 +5132,7 @@ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled sen **This endpoint allows you to delete the cancellation/pause of a scheduled send.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled. ### DELETE /user/scheduled_sends/{batch_id} @@ -5152,7 +5152,7 @@ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled sen **This endpoint allows you to update the status of a scheduled send for the given `batch_id`.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled. ### PATCH /user/scheduled_sends/{batch_id} @@ -5174,7 +5174,7 @@ The Cancel Scheduled Sends feature allows the customer to cancel a scheduled sen **This endpoint allows you to retrieve the cancel/paused scheduled send information for a specific `batch_id`.** -The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends cancelled less than 10 minutes before the scheduled time are not guaranteed to be cancelled. +The Cancel Scheduled Sends feature allows the customer to cancel a scheduled send based on a Batch ID included in the SMTPAPI header. Scheduled sends canceled less than 10 minutes before the scheduled time are not guaranteed to be canceled. ### GET /user/scheduled_sends/{batch_id} @@ -5237,7 +5237,7 @@ The Enforced TLS settings specify whether or not the recipient is required to su **This endpoint allows you to update the username for your account.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -5263,7 +5263,7 @@ For more information about your user profile: **This endpoint allows you to retrieve your current account username.** -Keeping your user profile up to date is important. This will help SendGrid to verify who you are as well as contact you should we need to. +Keeping your user profile up to date is essential. This will help SendGrid to verify who you are as well as contact you should we need to. For more information about your user profile: @@ -5289,7 +5289,7 @@ If an event type is marked as `true`, then the event webhook will include inform SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +Typical uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. ### PATCH /user/webhooks/event/settings @@ -5327,7 +5327,7 @@ If an event type is marked as `true`, then the event webhook will include inform SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +Typical uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. ### GET /user/webhooks/event/settings @@ -5347,7 +5347,7 @@ Common uses of this data are to remove unsubscribes, react to spam reports, dete SendGrids Event Webhook will notify a URL of your choice via HTTP POST with information about events that occur as SendGrid processes your email. -Common uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. +Typical uses of this data are to remove unsubscribes, react to spam reports, determine unengaged recipients, identify bounced email addresses, or create advanced analytics of your email program. ### POST /user/webhooks/event/test @@ -5476,7 +5476,7 @@ The inbound parse webhook allows you to have incoming emails parsed, extracting SendGrid's Inbound Parse Webhook allows you to parse the contents and attachments of incoming emails. The Parse API can then POST the parsed emails to a URL that you specify. The Inbound Parse Webhook cannot parse messages greater than 20MB in size, including all attachments. -There are a number of pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). +There are many pre-made integrations for the SendGrid Parse Webhook which make processing events easy. You can find these integrations in the [Library Index](https://sendgrid.com/docs/Integrate/libraries.html#-Webhook-Libraries). ### GET /user/webhooks/parse/stats @@ -5506,10 +5506,10 @@ There are a number of pre-made integrations for the SendGrid Parse Webhook which **This endpoint allows you to create a whitelabel for one of your domains.** If you are creating a domain whitelabel that you would like a subuser to use, you have two options: -1. Use the "username" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser is able to see and modify the created whitelabel. -2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their own whitelabel it will overwrite the assigned whitelabel. +1. Use the "username" parameter. This allows you to create a whitelabel on behalf of your subuser. This means the subuser can see and modify the created whitelabel. +2. Use the Association workflow (see Associate Domain section). This allows you to assign a whitelabel created by the parent to a subuser. This means the subuser will default to the assigned whitelabel, but will not be able to see or modify that whitelabel. However, if the subuser creates their whitelabel it will overwrite the assigned whitelabel. -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5542,7 +5542,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to retrieve a list of all domain whitelabels you have created.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5570,7 +5570,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to retrieve the default whitelabel for a domain.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5595,7 +5595,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to disassociate a specific whitelabel from a subuser.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. @@ -5624,7 +5624,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to retrieve all of the whitelabels that have been assigned to a specific subuser.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. @@ -5651,7 +5651,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to delete a domain whitelabel.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5673,7 +5673,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to update the settings for a domain whitelabel.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5698,7 +5698,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to retrieve a specific domain whitelabel.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5718,7 +5718,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to associate a specific domain whitelabel with a subuser.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. Domain whitelabels can be associated with (i.e. assigned to) subusers from a parent account. This functionality allows subusers to send mail using their parent's whitelabels. To associate a whitelabel with a subuser, the parent account must first create the whitelabel and validate it. The parent may then associate the whitelabel via the subuser management tools. @@ -5749,7 +5749,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to add an IP address to a domain whitelabel.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5778,7 +5778,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to remove a domain's IP address from that domain's whitelabel.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -5806,7 +5806,7 @@ For more information on whitelabeling, please see our [User Guide](https://sendg **This endpoint allows you to validate a domain whitelabel. If it fails, it will return an error message describing why the whitelabel could not be validated.** -A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your personal sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. +A domain whitelabel allows you to remove the via or sent on behalf of message that your recipients see when they read your emails. Whitelabeling a domain allows you to replace sendgrid.net with your sending domain. You will be required to create a subdomain so that SendGrid can generate the DNS records which you must give to your host provider. If you choose to use Automated Security, SendGrid will provide you with 3 CNAME records. If you turn Automated Security off, you will be given 2 TXT records and 1 MX record. For more information on whitelabeling, please see our [User Guide](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/index.html) @@ -6008,7 +6008,7 @@ For more information, please see our [User Guide](https://sendgrid.com/docs/API_ **This endpoint allows you to retrieve the default link whitelabel.** -Default link whitelabel is the actual link whitelabel to be used when sending messages. If there are multiple link whitelabels, the default is determined by the following order: +Default link whitelabel is the actual link whitelabel to be used when sending messages. If there are multiple link whitelabels, the following order will determine the default:
  • Validated link whitelabels marked as "default"
  • Legacy link whitelabels (migrated from the whitelabel wizard)
  • From 6a9bbfee426961a0c32391ff5415f57a72d91d7b Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 12:44:51 -0400 Subject: [PATCH 07/35] run USE_CASES.md through grammerly and update --- packages/client/USE_CASES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/USE_CASES.md b/packages/client/USE_CASES.md index e45ac562b..31e5cbaa3 100644 --- a/packages/client/USE_CASES.md +++ b/packages/client/USE_CASES.md @@ -1,4 +1,4 @@ -This documentation provides examples for specific SendGrid v3 API non mail/send use cases. Please [open an issue](https://github.com/sendgrid/sendgrid-nodejs/issues) or make a pull request for any use cases you would like us to document here. Thank you! +This document provides examples for specific SendGrid v3 API non-mail/send use cases. Please [open an issue](https://github.com/sendgrid/sendgrid-nodejs/issues) or make a pull request for any use cases you would like us to document here. Thank you! # Table of Contents From ce551926b5761b047b4340e69560ce46b6640313 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 12:49:18 -0400 Subject: [PATCH 08/35] run README.md through grammerly and update --- packages/helpers/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/helpers/README.md b/packages/helpers/README.md index e60eda13a..e9204c485 100644 --- a/packages/helpers/README.md +++ b/packages/helpers/README.md @@ -8,12 +8,12 @@ This is a collection of classes and helpers used internally by the [Sendgrid NodeJS libraries](https://www.npmjs.com/org/sendgrid). -Note that not all objects represented in the Sendgrid API have helper classes assigned to them, because it is not expected that developers will use these classes themselves. They are primarily for internal use and developers are expected to use the publicly exposed API in the [various endpoint services](https://www.npmjs.com/org/sendgrid). +Note that not all objects represented in the Sendgrid API have helper classes assigned to them because it is not expected that developers will use these classes themselves. They are primarily for internal use and developers are expected to use the publicly exposed API in the [various endpoint services](https://www.npmjs.com/org/sendgrid). To be notified when this package is updated, please subscribe to email [notifications](https://dx.sendgrid.com/newsletter/nodejs) for releases and breaking changes. ## Mail class -Used to compose a `Mail` object that converts itself to proper JSON for use with the [Sendgrid v3 API](https://sendgrid.com/docs/API_Reference/api_v3.html). This class supports a slightly different API to make sending emails easier in many cases by not having to deal with personalization arrays, instead offering a simpler interface for composing mails. +Used to compose a `Mail` object that converts itself to proper JSON for use with the [Sendgrid v3 API](https://sendgrid.com/docs/API_Reference/api_v3.html). This class supports a slightly different API to make sending emails easier in many cases by not having to deal with personalization arrays, instead offering a more straightforward interface for composing emails. ## Attachment class Used by the inbound mail parser to compose `Attachment` objects. @@ -39,8 +39,8 @@ We encourage contribution to our libraries (you might even score some nifty swag # About -@sendgrid/helpers is guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). +@sendgrid/helpers are guided and supported by the SendGrid [Developer Experience Team](mailto:dx@sendgrid.com). -@sendgrid/helpers is maintained and funded by SendGrid, Inc. The names and logos for @sendgrid/helpers are trademarks of SendGrid, Inc. +@sendgrid/helpers are maintained and funded by SendGrid, Inc. The names and logos for @sendgrid/helpers are trademarks of SendGrid, Inc. ![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png) From 09a0fbae15883b49fa0bb506e871d9a2a1da1189 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 12:51:26 -0400 Subject: [PATCH 09/35] run README.md through grammerly and update --- packages/inbound-mail-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/inbound-mail-parser/README.md b/packages/inbound-mail-parser/README.md index 54135a189..e487852e0 100644 --- a/packages/inbound-mail-parser/README.md +++ b/packages/inbound-mail-parser/README.md @@ -20,7 +20,7 @@ Grab your API Key from the [SendGrid UI](https://app.sendgrid.com/settings/api_k # Install Package -The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it. +The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it. ```sh npm install --save @sendgrid/inbound-mail-parser From d69443750f981baf3daf1a709a69fa9bf69df18f Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 12:54:42 -0400 Subject: [PATCH 10/35] run README.md through grammerly and update --- packages/mail/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mail/README.md b/packages/mail/README.md index a3633f366..eaa60e010 100644 --- a/packages/mail/README.md +++ b/packages/mail/README.md @@ -22,7 +22,7 @@ Grab your API Key from the [SendGrid UI](https://app.sendgrid.com/settings/api_k ## Setup Environment Variables -Do not hard code your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys) into your code. Instead, use an environment variable or some other secure means of protecting your SendGrid API Key. Following is an example of using an environment variable. +Do not hardcode your [SendGrid API Key](https://app.sendgrid.com/settings/api_keys) into your code. Instead, use an environment variable or some other secure means of protecting your SendGrid API Key. Following is an example of using an environment variable. Update the development environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys), for example: @@ -34,7 +34,7 @@ source ./sendgrid.env ## Install Package -The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it. +The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it. ```sh npm install --save @sendgrid/mail @@ -49,7 +49,7 @@ yarn add @sendgrid/mail # Quick Start, Hello Email -The following is the minimum needed code to send an simple email. Use this example, and modify the `to` and `from` variables: +The following is the minimum needed code to send a simple email. Use this example, and modify the `to` and `from` variables: For more complex use cases, please see [USE_CASES.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/packages/mail/USE_CASES.md). @@ -66,7 +66,7 @@ const msg = { sgMail.send(msg); ``` -After executing the above code, you should have an email in the inbox of the to recipient. You can check the status of your email [in the UI](https://app.sendgrid.com/email_activity?). Alternatively, we can post events to a URL of your choice using our [Event Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/event.html). This gives you data about the events that occur as SendGrid processes your email. +After executing the above code, you should have an email in the inbox of the recipient. You can check the status of your email [in the UI](https://app.sendgrid.com/email_activity?). Alternatively, we can post events to a URL of your choice using our [Event Webhook](https://sendgrid.com/docs/API_Reference/Webhooks/event.html). This gives you data about the events that occur as SendGrid processes your email. # Troubleshooting From 83786d5af2c6e2ea1dbd2ecfa56e682046f59a8a Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 13:07:26 -0400 Subject: [PATCH 11/35] run USE_CASES.md through grammerly and update --- packages/mail/USE_CASES.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/mail/USE_CASES.md b/packages/mail/USE_CASES.md index 55082892a..02d1b1215 100644 --- a/packages/mail/USE_CASES.md +++ b/packages/mail/USE_CASES.md @@ -74,12 +74,12 @@ const msg = { sgMail.sendMultiple(msg); ``` -Note that `sendMultiple(msg)` is a convenience shortcut for `send(msg, true)`, and alternatively you can also set the `isMultiple` flag to `true` on your `msg` object. +Note that `sendMultiple(msg)` is a convenience shortcut for `send(msg, true)`, and alternatively, you can also set the `isMultiple` flag to `true` on your `msg` object. # Send Multiple Emails to Multiple Recipients -The `send` method also accepts an array of email msg if you want to send multiple different single emails with for example different content and sender values. This will send multiple requests (in parallel), so be aware of any API rate restrictions: +The `send` method also accepts an array of email msg if you want to send multiple different single emails with, for example, different content and sender values. This will send multiple requests (in parallel), so be aware of any API rate restrictions: ```js const emails = [ @@ -469,7 +469,7 @@ const msg = { ## Managing multiple API keys In cases where you need to manage multiple instances of the mailer (or underlying client), -for example when you are using multiple API keys, you can import the mail service class and +for example, when you are using multiple API keys, you can import the mail service class and instantiate new instances as required: ```js @@ -573,7 +573,7 @@ $ sudo ln -s /opt/node/bin/npm /usr/local/bin/npm ``` ### Creating the repository -Next, create a directory to house our Node.js application that will send email. The application will be housed in a directory located at /var/www/domain.com +Next, create a directory to house our Node.js application that will send emails. The application will be housed in a directory located at /var/www/domain.com ``` $ cd /var $ mkdir www & cd www @@ -594,7 +594,7 @@ When you execute this command, you will have a blank line indicating that everyt #!/bin/sh git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f ``` -When you finish typing, press 'control-d' to save. In order to execute the file, we need to set the proper permissions using: +When you finish typing, press 'control-d' to save. To execute the file, we need to set the proper permissions using: ``` $ chmod +x post-receive ``` @@ -674,7 +674,7 @@ $ node index.js ## Deploy a Simple App on Google App Engine with Node.js -Before you begin, setup google app engine and install required packages by following [getting started](https://cloud.google.com/nodejs/getting-started/hello-world) guide. +Before you begin, setup Google App Engine and install required packages by following [getting started](https://cloud.google.com/nodejs/getting-started/hello-world) guide. #### Setup your environment variables Include your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) in `app.yaml`, for example: @@ -772,17 +772,17 @@ If you run into any other non SendGrid related issues, don't forget to read thro # How to Setup Email Sending on Azure -1. First create a account on azure. You can opt for free trial here or buy a subscription. -2. I am assuming you already have sendgrid API Key with you. +1. First, create an account on Azure. You can opt for a free trial here or buy a subscription. +2. I am assuming you already have a SendGrid API Key with you. 3. Create a sample node.js App. with an index.js and create a package.json file using npm init or yarn init. 4. Install sendgrid-nodejs as a dependency using yarn add @sendgrid/mail. -5. Now we need the SendGrid API key to be as an Environment Variable in our application. For that we will create an sendgrid.env file in our local system. Add it to .gitignore file and refresh the terminal. +5. Now we need the SendGrid API key to be as an Environment Variable in our application. For that, we will create a sendgrid.env file in our local system. Add it to .gitignore file and refresh the terminal. ```shell echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env echo "sendgrid.env" >> .gitignore source ./sendgrid.env ``` -6. Now lets go to our index.js file and copy paste the following code. +6. Now let's go to our index.js file and copy paste the following code. ```js const sgMail = require('@sendgrid/mail'); sgMail.setApiKey(process.env.SENDGRID_API_KEY); @@ -798,9 +798,9 @@ sgMail.send(msg); This will enable you to send a simple message to be sent to your email. 7. If you have followed all steps till here. Your app should work fine in local. Now it's time to deploy in Azure. -8. Follow the guide on [depolying to azure](https://docs.microsoft.com/en-us/azure/app-service/app-service-deploy-local-git) to the word. It might seem a little difficult to navigate with so many options but once you crack it, It will be a cakewalk. -9. Now as soon as you will deploy your application. It will run on the aforementioned port. You will again receive a message in your inbox. -10. And Voila you have your app deployed and sending Emails via Azure. Now you can chain your custome logic if you need to send emails as per some parameters and to specific people as per your requirement. +8. Follow the guide on [depolying to azure](https://docs.microsoft.com/en-us/azure/app-service/app-service-deploy-local-git) to the word. It might seem a little challenging to navigate with so many options but once you crack it, It will be a cakewalk. +9. Now as soon as you deploy your application, it will run on the aforementioned port. You will again receive a message in your inbox. +10. And Voila you have your app deployed and sending Emails via Azure. Now you can chain your custom logic if you need to send emails as per some parameters and to specific people as per your requirement. # How to Setup a Domain Whitelabel From b190590778470b4cc78753d3a9f7d1192ca20137 Mon Sep 17 00:00:00 2001 From: Daksh Date: Fri, 5 Oct 2018 22:47:49 +0530 Subject: [PATCH 12/35] kubernetes secrets "\n" problem. --- TROUBLESHOOTING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index aacd7a914..effbf904e 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -86,6 +86,12 @@ becomes In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key. +If you're using Kubernetes Secrets and passing the API Keys to the Environment using it, You may find that there is a `\n` charachter in the environment variable. You can use the trim function to remove it like this: + +``` +process.env.SENDGRID_API_KEY.trim(); +``` + ## Using the Package Manager From fd969d0588cbcc62d4dfd543b102100175f0a692 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 13:58:12 -0400 Subject: [PATCH 13/35] run README.md through grammerly and update --- packages/subscription-widget/README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/subscription-widget/README.md b/packages/subscription-widget/README.md index 7da406e62..fa69bed40 100644 --- a/packages/subscription-widget/README.md +++ b/packages/subscription-widget/README.md @@ -17,8 +17,8 @@ Before following these instructions, you must: ### Initial SendGrid Set-up - Create API Key & Contact List To begin, you will first need to create an API key on SendGrid's website. Once logged in, go to Settings -> API Keys, and click the blue button in the top right corner of the website. You will be creating a General API key, which must have *Full Access* to *Mail Send* and *Marketing Campaigns*. Keep this API key in a *safe* and *private* location. You will need it later. -### Fork this Repository to Create Your Own Copy -If you are unfamiliar with Github, simply click the button that reads *Fork* in the top right of this page. Doing this will provide you with your own copy. You'll need to change a few basic settings in your copy. +### Fork this Repository to Create Your Copy +If you are unfamiliar with Github, just click the button that reads *Fork* in the top right of this page. Doing this will provide you with your copy. You'll need to change a few basic settings in your copy. ### Deploy to Heroku @@ -49,12 +49,12 @@ exports.templateId = "dbc810ec-b776-4345-b0c7-02e2bbcd2ab4" By default, the widget is configured to save a new contact to your master list of ALL CONTACTS. However, you may choose to save new contacts to a specified custom list as well. To do so, you must first create a new contact list by navigating to Marketing Campaigns -> Contacts, and then click the blue button in the top right corner of the page. Once the list is created, you will require the list ID. You can find this number by navigating to the list and looking at the URL. The list ID will be the numbers following the last forward slash. For example, the list ID of a list with URL of https://sendgrid.com/marketing_campaigns/lists/651138 would be 651138. Once you have created a new list, change the value of exports.listId to the ID of that marketing list. This value is null by default. #### Use a Transactional Template (Optional) -You may also send your confirmation email using [transactional email templates](https://sendgrid.com/solutions/transactional-email-templates/) to give your email a more professional look and feel. To do so, you must first create a template by following the steps provided in [this guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). Once you have created a custom transacitonal email template, change the value of the exports.templateId to the ID of the template you created. If you choose to use templates, **you must include a substitution tag named "link_insert"**. This will be substituted with the link that signs up a user in the double opt-in process. (Example template below) +You may also send your confirmation email using [transactional email templates](https://sendgrid.com/solutions/transactional-email-templates/) to give your email a more professional look and feel. To do so, you must first create a template by following the steps provided in [this guide](https://sendgrid.com/docs/User_Guide/Transactional_Templates/index.html). Once you have created a custom transactional email template, change the value of the exports.templateId to the ID of the template you created. If you choose to use templates, **you must include a substitution tag named "link_insert"**. This will be substituted with the link that signs up a user in the double opt-in process. (Example template below) ![alt text](https://github.com/devchas/sendgrid_subscription_widget/blob/master/server/static/template.png "Transactional Email Template") #### Edit the Form with Your Custom URL -Navigate to the index.html file (server -> static -> index.html) and change the action in the form to reflect your app's URL. Remember to leave "/confirmEmail" at the end. The text in this file is what you will be embedding in your website. See below for an example. +Navigate to the index.html file (server -> static -> index.html) and change the action in the form to reflect your app's URL. Remember to leave "/confirmEmail" at the end. The text in this file is what you will embed in your website. See below for an example. ```html
    @@ -74,31 +74,31 @@ Navigate to the index.html file (server -> static -> index.html) and change the *Remember to always re-deploy your app after making any changes.* ### Add API Key as Environmental Variable on Heroku -Next, configure your API key as an environmental variable, which can be done either through Heroku's user interface or the Heroku CLI as shown in [these directions](https://devcenter.heroku.com/articles/config-vars). Updating the environment variable in your Heroku account can be done by logging into your heroku account, navigating to your newly deployed app, and clicking settings. Inside the settings page you will see an option to "Reveal Config Vars". You must name your variable holding your API key *SG_API_KEY*. +Next, configure your API key as an environmental variable, which can be done either through Heroku's user interface or the Heroku CLI as shown in [these directions](https://devcenter.heroku.com/articles/config-vars). Updating the environment variable in your Heroku account can be done by logging into your Heroku account, navigate to your newly deployed app, and clicking settings. Inside the settings page, you will see an option to "Reveal Config Vars". You must name your variable holding your API key *SG_API_KEY*. ### Enable Event Webhook -The final step is to enable the event webhook on your SendGrid account. This will allow the opt-in component of the signup to function properly. In order to set up an event webhook, navigate to Settings -> Mail Settings, and then click on *Event Notification*. +The final step is to enable the event webhook on your SendGrid account. This will allow the opt-in component of the signup to function correctly. To set up an event webhook, navigate to Settings -> Mail Settings, and then click on *Event Notification*. Make sure the toggle in the top left of that section is set to *ON*. Click edit. Enter the root URL of your Heroku app + '/signup'. The following is an example URL: https://your_heroku_app_name.herokuapp.com/signup. -For the types of events to receive, make sure to select only *Clicked*. Then, click the blue check box in the top right corner of the section to save changes. +For the types of events to receive, make sure to select only *Clicked*. Then, click the blue checkbox in the top right corner of the section to save changes. ### Test Your Widget -In order to easily test that your subscription widget is working properly, you may navigate to the root URL of your Heroku app and enter an email that you have access to. If everything is working, you should receive an email with a link to confirm your subscription. Upon clicking this link, the email should be added to the SendGrid contact list you created earlier. +To quickly test that your subscription widget is working correctly, you may navigate to the root URL of your Heroku app and enter an email that you have access to. If everything is working, you should receive an email with a link to confirm your subscription. Upon clicking this link, the email should be added to the SendGrid contact list you created earlier. ## Usage and Customization ### Usage -In order to use this widget, once you've followed the setup steps above, drop all of text from the index.html file you altered earlier into any website. +To use this widget, once you've followed the setup steps above, drop all of the text from the index.html file you altered earlier into any website. ### Customization -You may change the look and feel of the form or create a new one. The form will continue to work so long as the action is what you specified earlier, the method is post, and there is an input element with name *email*. The default widget comes with three fields: 1) email, 2) first name, 3) last name. You may remove first and/or last name if you so choose. In addition, you may change the form's styling by adjusting the CSS contained in index.html. +You may change the look and feel of the form or create a new one. The form will continue to work so long as the action is what you specified earlier, the method is a POST, and there is an input element with name *email*. The default widget comes with three fields: 1) email, 2) first name, 3) last name. You may remove first and/or last name if you so choose. Also, you may change the form's styling by adjusting the CSS contained in index.html. #### Adding New Fields -You may also add [custom fields](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/custom_fields.html) to the form to save other information about your users during the sign up process. To do so, simply add an additional input field with the name(s) of your custom field(s). If you add a custom field to your form that does not already exist in your SendGrid account, one will automatically be created with the name specified in the form. The example below shows a form with the custom field "favorite_color". +You may also add [custom fields](https://sendgrid.com/docs/User_Guide/Marketing_Campaigns/custom_fields.html) to the form to save other information about your users during the sign up process. To do so, simply add an input field with the name(s) of your custom field(s). If you add a custom field to your form that does not already exist in your SendGrid account, one will automatically be created with the name specified in the form. The example below shows a form with the custom field "favorite_color". ```html @@ -117,9 +117,9 @@ You may also add [custom fields](https://sendgrid.com/docs/User_Guide/Marketing_
    ``` -You may also change the look of the check-inbox.html and success.html files, both of which are located in the static folder with index.html. These are the pages that users will be directed to upon entering their email and cliking the confirmation link, respectively. +You may also change the look of the check-inbox.html and success.html files, both of which are located in the static folder with index.html. These are the pages that users will be directed to upon entering their email and clicking the confirmation link, respectively. -Finally, you may change the content of the confirmation email by changing the *mailText* variable in the contact_list_controller.js file, which is located in the controllers folder. However, be sure to keep the link intact. If you choose to use a transactional email template, the mail text will be produced by the template, and you may ignore this step. +Finally, you may change the content of the confirmation email by changing the *mailText* variable in the contact_list_controller.js file, which is located in the controllers folder. However, be sure to keep the link intact. If you choose to use a transactional email template, the template will produce the mail text, and you may ignore this step. ```javascript mailText = "Thanks for signing up! Click this link \ From 5b8005b6eb2ff3920ee424d2227c44666403511b Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:00:39 -0400 Subject: [PATCH 14/35] run cc-bcc-reply-to.md through grammerly and update --- use-cases/cc-bcc-reply-to.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-cases/cc-bcc-reply-to.md b/use-cases/cc-bcc-reply-to.md index daa8a564d..2f62b9474 100644 --- a/use-cases/cc-bcc-reply-to.md +++ b/use-cases/cc-bcc-reply-to.md @@ -1,6 +1,6 @@ # CC, BCC and Reply To -You can specify the `cc`, `bcc` and `replyTo` fields for more control over who you send the email to and where people will reply to: +You can specify the `cc`, `bcc`, and `replyTo` fields for more control over who you send the email to and where people will reply to: ```js const msg = { From 0f1d2c81a901b56f60bee61cc2822ada78c50e71 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:06:50 -0400 Subject: [PATCH 15/35] run single-email-multiple-recipients.md through grammerly and update --- use-cases/single-email-multiple-recipients.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-cases/single-email-multiple-recipients.md b/use-cases/single-email-multiple-recipients.md index eeb1471ed..cc611a9bc 100644 --- a/use-cases/single-email-multiple-recipients.md +++ b/use-cases/single-email-multiple-recipients.md @@ -30,4 +30,4 @@ const msg = { sgMail.sendMultiple(msg); ``` -Note that `sendMultiple(msg)` is a convenience shortcut for `send(msg, true)`, and alternatively you can also set the `isMultiple` flag to `true` on your `msg` object. +Note that `sendMultiple(msg)` is a convenience shortcut for `send(msg, true)`, and alternatively, you can also set the `isMultiple` flag to `true` on your `msg` object. From c71a7884a9f790e1fb4f95f04cc75226234b2791 Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:14:51 -0400 Subject: [PATCH 16/35] run CODE_OF_CONDUCT.md through grammerly and update --- CODE_OF_CONDUCT.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b2439f6ad..7ccbcff0c 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ # SendGrid Community Code of Conduct -The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community. +The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, thriving and growing community. ### Be Open Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference. @@ -9,7 +9,7 @@ Members of the community are open to collaboration, whether it's on pull request Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views. ### Be Respectful -Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally. +Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments, and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally. ## Additional Guidance From 028f0eaa481ea2310c910db67a8c2d2bc25b3ecf Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:36:45 -0400 Subject: [PATCH 17/35] run CONTRIBUTING.md through grammerly and update --- CONTRIBUTING.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53cbbaf56..fed0deccc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,14 +13,14 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou - [Code Reviews](#code-reviews) -We use [Milestones](https://github.com/sendgrid/sendgrid-nodejs/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged. +We use [Milestones](https://github.com/sendgrid/sendgrid-nodejs/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions, and additional PRs are welcomed and encouraged. ## CLAs and CCLAs Before you get started, SendGrid requires that a SendGrid Contributor License Agreement (CLA) be filled out by every contributor to a SendGrid open source project. -Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when making a contribution. In this way the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution. +Our goal with the CLA is to clarify the rights of our contributors and reduce other risks arising from inappropriate contributions. The CLA also clarifies the rights SendGrid holds in each contribution and helps to avoid misunderstandings over what rights each contributor is required to grant to SendGrid when contributing. In this way, the CLA encourages broad participation by our open source community and helps us build strong open source projects, free from any individual contributor withholding or revoking rights to any contribution. SendGrid does not merge a pull request made against a SendGrid open source project until that pull request is associated with a signed CLA. Copies of the CLA are available [here](https://gist.github.com/SendGridDX/98b42c0a5d500058357b80278fde3be8#file-sendgrid_cla). @@ -35,7 +35,7 @@ If you'd like to make a feature request, please read this section. The GitHub [issue tracker](https://github.com/sendgrid/sendgrid-nodejs/issues) is the preferred channel for library feature requests, but please respect the following restrictions: -- Please [**search for existing issues**](https://github.com/search?utf8=%E2%9C%93&q=repo%3Asendgrid%2Fsendgrid-nodejs&type=Issues) in order to ensure we don't have duplicate bugs/feature requests. +- Please [**search for existing issues**](https://github.com/search?utf8=%E2%9C%93&q=repo%3Asendgrid%2Fsendgrid-nodejs&type=Issues) to ensure we don't have duplicate bugs/feature requests. - Please be respectful and considerate of others when commenting on issues @@ -43,17 +43,17 @@ The GitHub [issue tracker](https://github.com/sendgrid/sendgrid-nodejs/issues) i Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public. -A software bug is a demonstrable issue in the code base. In order for us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report. +A software bug is a demonstrable issue in the code base. For us to diagnose the issue and respond as quickly as possible, please add as much detail as possible into your bug report. Before you decide to create a new issue, please try the following: 1. [Check the Github issues tab](https://github.com/sendgrid/sendgrid-nodejs/issues) if the identified issue has already been reported, if so, please add a +1 to the existing post. -2. Update to the latest version of this code and check if issue has already been fixed +2. Update to the latest version of this code and check if the issue has already been fixed 3. Copy and fill in the Bug Report Template we have provided below ### Please use our Bug Report Template -In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-nodejs/blob/master/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. +To make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/sendgrid-nodejs/blob/master/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting. ## Improvements to the Codebase @@ -113,7 +113,7 @@ This repo is organized as a monorepo with the packages residing in the `./packag ## Codebase Overview -This repo is subdivided in 6 main [packages](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages). Each package has its own dependencies (internal or external) and its own source code in the `src` folder. Each package also has its isolated ReadME files, use cases and usage.md files. +This repo is subdivided into 6 main [packages](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages). Each package has its dependencies (internal or external) and its source code in the `src` folder. Each package also has its isolated ReadME files, use cases, and usage.md files. To install a particular packages' dependencies. ```bash @@ -129,7 +129,7 @@ Type declarations: client.d.ts Test Cases: client.spec.js **2. Mail** -This module exposes the `send` function which send mails via the sdk. This module can be a good starting point to read the source code. +This module exposes the `send` function which sends mail via the sdk. This module can be a good starting point to read the source code. Type declarations: mail.d.ts Test Cases: mail.spec.js @@ -194,7 +194,7 @@ Please run your code through: 4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) - or your code is unlikely be merged into the main project. Use Git's + or your code is unlikely to be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. @@ -222,4 +222,4 @@ If you have any additional questions, please feel free to [email](mailto:dx@send ## Code Reviews -If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how, Github has some [great information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/). +If you can, please look at open PRs and review them. Give feedback and help us merge these PRs much faster! If you don't know how Github has some [great information on how to review a Pull Request](https://help.github.com/articles/about-pull-request-reviews/). From cefa6844dd26c6fa9856a1806b2b09ed8343dccd Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:39:54 -0400 Subject: [PATCH 18/35] run README.md through grammerly and update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c0e4c54d..59dfc5633 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ **This library allows you to quickly and easily use the SendGrid Web API v3 via Node.js.** -We want this library to be community-driven, and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-nodejs/issues) and [pull requests](https://github.com/sendgrid/sendgrid-nodejs/blob/master/CONTRIBUTING.md) or simply upvote or comment on existing issues or pull requests. +We want this library to be community-driven, and SendGrid led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/sendgrid/sendgrid-nodejs/issues) and [pull requests](https://github.com/sendgrid/sendgrid-nodejs/blob/master/CONTRIBUTING.md) or merely upvote or comment on existing issues or pull requests. For updates to this library, see our [CHANGELOG](https://github.com/sendgrid/sendgrid-nodejs/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-nodejs/releases). @@ -33,7 +33,7 @@ We appreciate your continued support, thank you! # Introduction - Please Read First -This library is broken up into several packages as a monorepo so that you only need to install the packages necessary for your use case. This README contains information pertaining to all packages. For examples on how to get started quickly, head over to the READMEs of each individual package (linked and described below), which includes detailed examples. +This library is broken up into several packages as a monorepo so that you only need to install the packages necessary for your use case. This README contains information about all packages. For examples on how to get started quickly, head over to the READMEs of each package (linked and described below), which includes detailed examples. * **[@sendgrid/mail](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/mail) - if you just want to send email** * **[@sendgrid/client](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/client) - to use all other [SendGrid v3 Web API endpoints](https://sendgrid.com/docs/API_Reference/api_v3.html)** From 930454301264fb1761bf0d2f68c75cac7979055d Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:44:23 -0400 Subject: [PATCH 19/35] run TROUBLESHOOTING.md through grammerly and update --- TROUBLESHOOTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index aacd7a914..c1f1be219 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -24,7 +24,7 @@ Please review [our guide](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/ [Here](https://github.com/sendgrid/sendgrid-nodejs/tree/b57b32caa47608a15d23940a0dedc82a91e7b6aa) is the last working version with v2 support. -The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x therefore you likely already have it. +The following recommended installation requires [npm](https://npmjs.org/). If you are unfamiliar with npm, see the [npm docs](https://npmjs.org/doc/). Npm comes installed with Node.js since node version 0.8.x, therefore, you likely already have it. Add the following to your `package.json` file: @@ -59,7 +59,7 @@ Click the "Clone or download" green button in [GitHub](https://github.com/sendgr ## Testing v3 /mail/send Calls Directly -[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases. +[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for everyday use cases. ## Error Messages @@ -69,7 +69,7 @@ To read the error message returned by SendGrid's API, please see [this example]( ## Versions -We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are working with to your code and never auto-update to the latest version. Especially when there is a MAJOR point release, since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-nodejs/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-nodejs/releases) section. +We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](http://semver.org). Therefore, we recommend that you always pin (or vendor) the particular version you are utilizing with your code and never auto-update to the latest version. Especially when there is a MAJOR point release since that is guaranteed to be a breaking change. Changes are documented in the [CHANGELOG](https://github.com/sendgrid/sendgrid-nodejs/blob/master/CHANGELOG.md) and [releases](https://github.com/sendgrid/sendgrid-nodejs/releases) section. ## Environment Variables and Your SendGrid API Key @@ -84,7 +84,7 @@ becomes `'SENDGRID_API_KEY'` -In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key. +In the first case, SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key. ## Using the Package Manager From c2f25fcaf9807fbc1f241683ded269e4ce05bc4f Mon Sep 17 00:00:00 2001 From: alanunruh Date: Fri, 5 Oct 2018 14:46:41 -0400 Subject: [PATCH 20/35] run USAGE.md through grammerly and update --- USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USAGE.md b/USAGE.md index b4e5cb335..965a7dd59 100644 --- a/USAGE.md +++ b/USAGE.md @@ -1,7 +1,7 @@ # Introduction This library is broken up into several packages as a monorepo so that you only need to install the packages necessary for your use case. -This USAGE.md contains information pertaining to all packages. For examples on how to get started quickly, head over to the READMEs of each individual package (linked and described below), which includes detailed examples. +This USAGE.md contains information about all packages. For examples on how to get started quickly, head over to the READMEs of each package (linked and described below), which includes detailed examples. * [@sendgrid/mail](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/mail) - if you just want to send email * [@sendgrid/client](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/client) - to use all other [SendGrid v3 Web API endpoints](https://sendgrid.com/docs/API_Reference/api_v3.html) From f09d1a3723c4abe6f1b78a4a65d9bd03d65bca22 Mon Sep 17 00:00:00 2001 From: Arshad Kazmi Date: Sat, 6 Oct 2018 21:23:35 +0530 Subject: [PATCH 21/35] Fixes broken link to USE_CASE directory --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53cbbaf56..a189081a5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,7 +81,7 @@ npm install First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-nodejs). -You will need to setup the following environment to use the SendGrid examples in the [README.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md), [USAGE.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/USAGE.MD) and [USE_CASES.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/USE_CASES.md) files: +You will need to setup the following environment to use the SendGrid examples in the [README.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md), [USAGE.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/USAGE.MD) and [USE_CASES](https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/README.md) files: ```bash echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env From 9352bca16d7be2896087feb4227fb3a94d65b8a5 Mon Sep 17 00:00:00 2001 From: Arshad Kazmi Date: Sat, 6 Oct 2018 21:29:42 +0530 Subject: [PATCH 22/35] Usage link fix, esdoc link fix --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a189081a5..9326f6758 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,7 +81,7 @@ npm install First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-nodejs). -You will need to setup the following environment to use the SendGrid examples in the [README.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md), [USAGE.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/USAGE.MD) and [USE_CASES](https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/README.md) files: +You will need to setup the following environment to use the SendGrid examples in the [README.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md), [USAGE.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/USAGE.md) and [USE_CASES](https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/README.md) files: ```bash echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env @@ -160,7 +160,7 @@ Generally, we follow the style guidelines as suggested by the official language. Please run your code through: - [ESLint](http://eslint.org/) with the standard style guide. -- [esdoc](https://github.com/sendgrid/sendgrid-nodejs/blob/master/.github/USAGE.md) to check the documentation coverage of your added code. +- [esdoc](https://esdoc.org/) to check the documentation coverage of your added code. ## Creating a Pull Request From 5a6e1b5e7029438fce987b002e59c7366daf4004 Mon Sep 17 00:00:00 2001 From: Arshad Kazmi Date: Sat, 6 Oct 2018 21:54:34 +0530 Subject: [PATCH 23/35] v3 send email broken link fixed in TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index aacd7a914..7139ee122 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -59,7 +59,7 @@ Click the "Clone or download" green button in [GitHub](https://github.com/sendgr ## Testing v3 /mail/send Calls Directly -[Here](https://sendgrid.com/docs/Classroom/Send/v3_Mail_Send/curl_examples.html) are some cURL examples for common use cases. +[Here](https://sendgrid.com/docs/for-developers/sending-email/curl-examples/) are some cURL examples for common use cases. ## Error Messages From 77d2df5a382464beaa1c343e71189b0ff816222f Mon Sep 17 00:00:00 2001 From: Ishaan Malhi Date: Sun, 7 Oct 2018 17:23:52 +0530 Subject: [PATCH 24/35] docs: specify custom arguments must have string values - Resolves #658 --- use-cases/customization.md | 4 ++-- use-cases/kitchen-sink.md | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/use-cases/customization.md b/use-cases/customization.md index c14013bd2..127c64efd 100644 --- a/use-cases/customization.md +++ b/use-cases/customization.md @@ -16,7 +16,7 @@ const msg = { 'X-Custom-Header': 'Recipient 1', }, customArgs: { - myArg: 'Recipient 1', + myArg: 'Recipient 1', // must be a string }, }, { @@ -30,7 +30,7 @@ const msg = { 'X-Custom-Header': 'Recipient 2', }, customArgs: { - myArg: 'Recipient 1', + myArg: 'Recipient 1', // must be a string }, sendAt: 1500077141, } diff --git a/use-cases/kitchen-sink.md b/use-cases/kitchen-sink.md index b9bba23f7..bec00e71c 100644 --- a/use-cases/kitchen-sink.md +++ b/use-cases/kitchen-sink.md @@ -33,7 +33,7 @@ const msg = { }, sections: {}, customArgs: { - myCustomArg: 123, + myCustomArg: 'some string', // must be a string }, batchId: 'sendgrid-batch-id', asm: { @@ -48,3 +48,7 @@ sgMail .then(() => console.log('Mail sent successfully')) .catch(error => console.error(error.toString())); ``` + +### Error Handling: + +As per [issue #288](https://github.com/sendgrid/sendgrid-nodejs/issues/288), please note that the `customArgs` feild *must* have a string value. From bae6f26e05bce2668805407be655368bcc5d245d Mon Sep 17 00:00:00 2001 From: Siddhant Sharma Date: Sun, 7 Oct 2018 19:39:50 +0530 Subject: [PATCH 25/35] #765 - Updating the troubleshooting.md Added the #692 multi line codes in
     turn to one line after mail send,
    to the troubleshooting.md on your request.
    
    Co-Authored-By: Elmer Thomas 
    ---
     TROUBLESHOOTING.md | 43 +++++++++++++++++++++++++++++++++++++++++++
     1 file changed, 43 insertions(+)
    
    diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md
    index aacd7a914..8a56721d2 100644
    --- a/TROUBLESHOOTING.md
    +++ b/TROUBLESHOOTING.md
    @@ -13,6 +13,7 @@ If you can't find a solution below, please open an [issue](https://github.com/se
     * [Environment Variables and Your SendGrid API Key](#environment)
     * [Using the Package Manager](#package-manager)
     * [Viewing the Request Body](#request-body)
    +* [Wrapping Text](#wrapping-text)
     
     
     ## Migrating from v2 to v3
    @@ -126,3 +127,45 @@ const mail = Mail.create(data);
     const body = mail.toJSON();
     console.log(body);
     ```
    +
    +
    +## Wrapping Text
    +
    +You can write blog posts using e-mail with the help of SENDGRID API, like so:
    +```javascript
    +sgMail.setApiKey(process.env.SENDGRID_API_KEY);
    +      let msg = {
    +        to: '@blogger.com',
    +        from: '@gmail.com',
    +        subject: title,
    +        html: html,
    +      };
    +     sgMail.send(msg);
    +``` 
    +You can also wrap the text in the HTML to make a multi-line blog post:
    +```javascript
    +
    + int a = 10; + int b = 10; + int d = 10; + +
    +``` + + + + + + + + + + + + + + + + + + From f80b1d2b0610ee840674a5f04bedaa18c30eeabd Mon Sep 17 00:00:00 2001 From: PyroclasticMayhem Date: Sun, 7 Oct 2018 16:01:00 -0400 Subject: [PATCH 26/35] Correct link for environment variables setup --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index aacd7a914..a9d7e741b 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -74,7 +74,7 @@ We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](h ## Environment Variables and Your SendGrid API Key -All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-nodejs#setup-environment-variables) to hold your SendGrid API key. +All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/client#setup-environment-variables) to hold your SendGrid API key. If you choose to add your SendGrid API key directly (not recommended): From e550efc8f2e744c7648ac76adcdaa3b93707d6b7 Mon Sep 17 00:00:00 2001 From: Stuart Reed Date: Mon, 8 Oct 2018 22:24:00 -0600 Subject: [PATCH 27/35] Warn if dynamic template contains non-escaped character --- packages/helpers/classes/mail.js | 20 +++++++-- packages/helpers/classes/mail.spec.js | 60 +++++++++++++++++++++++++++ packages/helpers/constants/index.js | 8 ++++ use-cases/transactional-templates.md | 51 +++++++++++++++++++++++ 4 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 packages/helpers/constants/index.js diff --git a/packages/helpers/classes/mail.js b/packages/helpers/classes/mail.js index 5bb06d076..b6f83321b 100644 --- a/packages/helpers/classes/mail.js +++ b/packages/helpers/classes/mail.js @@ -9,6 +9,7 @@ const toCamelCase = require('../helpers/to-camel-case'); const toSnakeCase = require('../helpers/to-snake-case'); const deepClone = require('../helpers/deep-clone'); const arrayToJSON = require('../helpers/array-to-json'); +const { DYNAMIC_TEMPLATE_CHAR_WARNING } = require('../constants'); /** * Mail class @@ -87,8 +88,9 @@ class Mail { this.setTrackingSettings(trackingSettings); if (this.isDynamic) { - this.setDynamicTemplateData(dynamicTemplateData) - } else { + this.setDynamicTemplateData(dynamicTemplateData); + } + else { this.setSubstitutions(substitutions); this.setSubstitutionWrappers(substitutionWrappers); } @@ -242,7 +244,8 @@ class Mail { //depending on the templateId if (this.isDynamic && personalization.substitutions) { delete personalization.substitutions; - } else if (personalization.dynamicTemplateData) { + } + else if (personalization.dynamicTemplateData) { delete personalization.dynamicTemplateData; } @@ -254,7 +257,8 @@ class Mail { //If this is dynamic, set dynamicTemplateData, or set substitutions if (this.isDynamic) { this.applyDynamicTemplateData(personalization); - } else { + } + else { this.applySubstitutions(personalization); } @@ -333,6 +337,14 @@ class Mail { if (typeof dynamicTemplateData !== 'object') { throw new Error('Object expected for `dynamicTemplateData`'); } + + // Check dynamic template for non-escaped characters and warn if found + Object.values(dynamicTemplateData).forEach(value => { + if (/['"&]/.test(value)) { + console.warn(DYNAMIC_TEMPLATE_CHAR_WARNING); + } + }); + this.dynamicTemplateData = dynamicTemplateData; } diff --git a/packages/helpers/classes/mail.spec.js b/packages/helpers/classes/mail.spec.js index 9177bde81..c1de9fcbc 100644 --- a/packages/helpers/classes/mail.spec.js +++ b/packages/helpers/classes/mail.spec.js @@ -4,6 +4,7 @@ * Dependencies */ const Mail = require('./mail'); +const { DYNAMIC_TEMPLATE_CHAR_WARNING } = require('../constants'); /** * Tests @@ -154,4 +155,63 @@ describe('Mail', function() { }); }); + + describe('dynamic template handlebars substitutions', () => { + let logSpy, data; + + beforeEach(() => { + logSpy = sinon.spy(console, 'warn'); + data = { + to: 'recipient@example.org', + from: 'sender@example.org', + subject: 'Hello world', + text: 'Hello plain world!', + html: '

    Hello HTML world!

    ', + templateId: 'd-df80613cccc6441ea5cd7c95377bc1ef', + }; + }); + + afterEach(() => { + console.warn.restore(); + }); + + it('should log an error if template subject line contains improperly escaped "\'" character', () => { + data = Object.assign(data, { + dynamicTemplateData: { + subject: 'Testing Templates and \'Stuff\'', + }, + }); + + const mail = new Mail(data); + + expect(logSpy.calledOnce).to.equal(true); + expect(logSpy.calledWith(DYNAMIC_TEMPLATE_CHAR_WARNING)).to.equal(true); + }); + + it('should log an error if template subject line contains improperly escaped """ character', () => { + data = Object.assign(data, { + dynamicTemplateData: { + subject: '"Testing Templates" and Stuff', + }, + }); + + const mail = new Mail(data); + + expect(logSpy.calledOnce).to.equal(true); + expect(logSpy.calledWith(DYNAMIC_TEMPLATE_CHAR_WARNING)).to.equal(true); + }); + + it('should log an error if template subject line contains improperly escaped "&" character', () => { + data = Object.assign(data, { + dynamicTemplateData: { + subject: 'Testing Templates & Stuff', + }, + }); + + const mail = new Mail(data); + + expect(logSpy.calledOnce).to.equal(true); + expect(logSpy.calledWith(DYNAMIC_TEMPLATE_CHAR_WARNING)).to.equal(true); + }); + }); }); diff --git a/packages/helpers/constants/index.js b/packages/helpers/constants/index.js new file mode 100644 index 000000000..4429da31e --- /dev/null +++ b/packages/helpers/constants/index.js @@ -0,0 +1,8 @@ +const DYNAMIC_TEMPLATE_CHAR_WARNING = ` +Content with characters ', " or & may need to be escaped with three brackets +{{{ content }}} +See https://sendgrid.com/docs/ui/sending-email/using-handlebars/ for more information.`; + +module.exports = { + DYNAMIC_TEMPLATE_CHAR_WARNING, +}; diff --git a/use-cases/transactional-templates.md b/use-cases/transactional-templates.md index 0e8c40077..c0c0f3e1e 100644 --- a/use-cases/transactional-templates.md +++ b/use-cases/transactional-templates.md @@ -48,3 +48,54 @@ sgMail.send(msg); ``` There's no need to specify the substitution wrappers as it will assume that you're using [Handlebars](https://handlebarsjs.com/) templating by default. + +## Prevent Escaping Characters + +Per Handlebars' documentation: If you don't want Handlebars to escape a value, use the "triple-stash", {{{ + +> If you include the characters ', " or & in a subject line replacement be sure to use three brackets. + +Email Subject: + +```text +{{{ subject }}} +``` + +Template Body: + +```html + + + + + +Hello {{{ name }}}, +

    +I'm glad you are trying out the template feature! +

    +<%body%> +

    +I hope you are having a great day in {{{ city }}} :) +

    + + +``` + +```js +const sgMail = require('@sendgrid/mail'); +sgMail.setApiKey(process.env.SENDGRID_API_KEY); +const msg = { + to: 'recipient@example.org', + from: 'sender@example.org', + subject: 'Hello world', + text: 'Hello plain world!', + html: '

    Hello HTML world!

    ', + templateId: 'd-f43daeeaef504760851f727007e0b5d0', + dynamic_template_data: { + subject: 'Testing Templates & Stuff', + name: 'Some "Testing" One', + city: 'Denver', + }, +}; +sgMail.send(msg); +``` From b23949edf2c528bdc7c34ab0e067793c6460e472 Mon Sep 17 00:00:00 2001 From: PyroclasticMayhem Date: Tue, 9 Oct 2018 14:58:50 -0400 Subject: [PATCH 28/35] Use relative link for environment variables setup --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index a9d7e741b..f29b11a5c 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -74,7 +74,7 @@ We follow the MAJOR.MINOR.PATCH versioning scheme as described by [SemVer.org](h ## Environment Variables and Your SendGrid API Key -All of our examples assume you are using [environment variables](https://github.com/sendgrid/sendgrid-nodejs/tree/master/packages/client#setup-environment-variables) to hold your SendGrid API key. +All of our examples assume you are using [environment variables](packages/client#setup-environment-variables) to hold your SendGrid API key. If you choose to add your SendGrid API key directly (not recommended): From b7ffffff036ae2df3efaa1ce2a3b844dbb2f5a15 Mon Sep 17 00:00:00 2001 From: Arshad Kazmi Date: Wed, 10 Oct 2018 20:29:51 +0530 Subject: [PATCH 29/35] Changed links to relative links, removed 'md' from filename with relative links --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9326f6758..a7811fedc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,7 +81,7 @@ npm install First, get your free SendGrid account [here](https://sendgrid.com/free?source=sendgrid-nodejs). -You will need to setup the following environment to use the SendGrid examples in the [README.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/README.md), [USAGE.md](https://github.com/sendgrid/sendgrid-nodejs/blob/master/USAGE.md) and [USE_CASES](https://github.com/sendgrid/sendgrid-nodejs/blob/master/use-cases/README.md) files: +You will need to setup the following environment to use the SendGrid examples in the [README](README.md), [USAGE](USAGE.md) and [USE_CASES](use-cases/README.md) files: ```bash echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env From 18b9cf39f054fb22c0c8decbe3c76b9f2795adbb Mon Sep 17 00:00:00 2001 From: Daksh Date: Thu, 11 Oct 2018 00:28:23 +0530 Subject: [PATCH 30/35] fix typo --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index effbf904e..b7b951f0a 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -86,7 +86,7 @@ becomes In the first case SENDGRID_API_KEY is in reference to the name of the environment variable, while the second case references the actual SendGrid API Key. -If you're using Kubernetes Secrets and passing the API Keys to the Environment using it, You may find that there is a `\n` charachter in the environment variable. You can use the trim function to remove it like this: +If you're using Kubernetes Secrets and passing the API Keys to the Environment using it, You may find that there is a `\n` character in the environment variable. You can use the trim function to remove it like this: ``` process.env.SENDGRID_API_KEY.trim(); From c01735ba34e92a56ad33e069db4bfc71f92a35d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Chio?= Date: Sat, 13 Oct 2018 01:21:02 -0400 Subject: [PATCH 31/35] Update OSI code of conduct link --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index b2439f6ad..98ce2e089 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -37,5 +37,5 @@ Finally, just a reminder, changes to the SendGrid repositories will only be acce SendGrid thanks the following, on which it draws for content and inspiration: * [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/) -* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct) +* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct/licensing) * [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html) From 10238856ad0e057e42a7b620a89f049d8c40751a Mon Sep 17 00:00:00 2001 From: Siddhant Sharma Date: Sun, 14 Oct 2018 00:30:28 +0530 Subject: [PATCH 32/35] Updated with revised changes! @reedsa Updated the file with your requested changes! --- TROUBLESHOOTING.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 8a56721d2..1f2a5fc04 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -133,24 +133,24 @@ console.log(body); You can write blog posts using e-mail with the help of SENDGRID API, like so: ```javascript -sgMail.setApiKey(process.env.SENDGRID_API_KEY); - let msg = { - to: '@blogger.com', - from: '@gmail.com', - subject: title, - html: html, - }; - sgMail.send(msg); +sgMail.setApiKey(process.env.SendGrid_API_KEY); +let msg = { + to: '@blogger.com', + from: '@gmail.com', + subject: title, + html: html, +}; +sgMail.send(msg); ``` You can also wrap the text in the HTML to make a multi-line blog post: ```javascript -
    - int a = 10; - int b = 10; - int d = 10; - +
    + + int a = 10; + int b = 10; + int d = 10; +
    -``` From 13ca322435a76ebecad6851c3d617da91e16be3d Mon Sep 17 00:00:00 2001 From: Ishaan Malhi Date: Sun, 14 Oct 2018 13:02:44 +0530 Subject: [PATCH 33/35] docs: Change title --- use-cases/kitchen-sink.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/use-cases/kitchen-sink.md b/use-cases/kitchen-sink.md index bec00e71c..3108f1187 100644 --- a/use-cases/kitchen-sink.md +++ b/use-cases/kitchen-sink.md @@ -49,6 +49,6 @@ sgMail .catch(error => console.error(error.toString())); ``` -### Error Handling: +### Caveats: As per [issue #288](https://github.com/sendgrid/sendgrid-nodejs/issues/288), please note that the `customArgs` feild *must* have a string value. From 799fc50e6ad550b1d3d443c6809784500b8ca13a Mon Sep 17 00:00:00 2001 From: Siddhant Sharma Date: Mon, 15 Oct 2018 23:50:20 +0530 Subject: [PATCH 34/35] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 1f2a5fc04..f2d8f36be 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -131,7 +131,7 @@ console.log(body); ## Wrapping Text -You can write blog posts using e-mail with the help of SENDGRID API, like so: +You can write blog posts using e-mail with the help of SendGrid API, like so: ```javascript sgMail.setApiKey(process.env.SendGrid_API_KEY); let msg = { From 957f806b6436a109e6f3382ba3da222b5ad9826a Mon Sep 17 00:00:00 2001 From: Siddhant Sharma Date: Mon, 15 Oct 2018 23:51:55 +0530 Subject: [PATCH 35/35] Update TROUBLESHOOTING.md --- TROUBLESHOOTING.md | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index f2d8f36be..a8c6a1e2b 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -151,21 +151,3 @@ You can also wrap the text in the HTML to make a multi-line blog post: int d = 10;
    - - - - - - - - - - - - - - - - - -