From 25bbdf05e7705ea5fc83e8d38c96c1d7c843115e Mon Sep 17 00:00:00 2001 From: Dylan Marty Date: Thu, 22 Nov 2018 10:16:41 -0600 Subject: [PATCH 1/3] Add sandbox setting to kitchen-sink documentation --- packages/mail/USE_CASES.md | 22 +++++++++++++--------- use-cases/kitchen-sink.md | 6 +++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/packages/mail/USE_CASES.md b/packages/mail/USE_CASES.md index 2b697a6df..ed82d57cb 100644 --- a/packages/mail/USE_CASES.md +++ b/packages/mail/USE_CASES.md @@ -474,7 +474,11 @@ const msg = { groupId: 1 }, ipPoolName: 'sendgrid-ip-pool-name', - mailSettings: {}, + mailSettings: { + sandbox: { + enable: true, + }, + }, trackingSettings: {}, }; sgMail @@ -489,7 +493,7 @@ sgMail 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: +Include your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) in `app.yaml`, for example: ```yaml # Note: Don't commit the app.yaml file with API key, keep it changed locally - only used in deployment @@ -527,7 +531,7 @@ const app = express(); app.get('/send', (req, res) => { const {query: {to = 'test@example.com', from = 'test@example.com'}} = req; // other options could be customized further - + const msg = { to, from, @@ -535,7 +539,7 @@ app.get('/send', (req, res) => { text: 'and easy to do anywhere, even with Node.js', html: 'Hello Email app', }; - + sgMail.send(msg).then(() => { res.status(200).send('Hello, world!').end(); }).catch(e => { @@ -558,11 +562,11 @@ app.listen(PORT, () => { ``` gcloud app deploy ``` - - #### Send email - + + #### Send email + Using the following snippet you should be able to send emails with the deployed app (replace `to` and `from` with your own) - + ```curl curl -X GET \ 'http://your_project_id.appspot.com/send?to=to%40example.com&from=from%40example.com' \ @@ -580,7 +584,7 @@ Here are step by step instructions to deploy your Node.js app to Heroku (assumin - `heroku config:set SENDGRID_API_KEY=SG.YOUR.OWN-API_KEY-HERE` (replace `SG.YOUR.OWN-API_KEY-HERE` with your own [api key from sendgrid](https://app.sendgrid.com/settings/api_keys) If you run into any other non SendGrid related issues, don't forget to read through [Heroku's deployment documentation](https://devcenter.heroku.com/articles/getting-started-with-nodejs). - + # How to Setup a Domain Whitelabel diff --git a/use-cases/kitchen-sink.md b/use-cases/kitchen-sink.md index b9bba23f7..87ed9e43b 100644 --- a/use-cases/kitchen-sink.md +++ b/use-cases/kitchen-sink.md @@ -40,7 +40,11 @@ const msg = { groupId: 1 }, ipPoolName: 'sendgrid-ip-pool-name', - mailSettings: {}, + mailSettings: { + sandbox: { + enable: true, + }, + }, trackingSettings: {}, }; sgMail From 8b78d3e044780c923cfd2e5686bb1d3e58245e80 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 20 May 2020 09:14:04 -0500 Subject: [PATCH 2/3] Update USE_CASES.md --- packages/mail/USE_CASES.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/mail/USE_CASES.md b/packages/mail/USE_CASES.md index c1603c883..e16638130 100644 --- a/packages/mail/USE_CASES.md +++ b/packages/mail/USE_CASES.md @@ -560,10 +560,7 @@ const msg = { }, subscriptionTracking: { enable: true - }, - sandbox: { - enable: true - }, + } }, }; sgMail From 05d5c3194fda0eccccc2b25f550ebd9cc9d48cda Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Wed, 20 May 2020 09:17:10 -0500 Subject: [PATCH 3/3] Update USE_CASES.md --- packages/mail/USE_CASES.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/mail/USE_CASES.md b/packages/mail/USE_CASES.md index e16638130..e538e1df0 100644 --- a/packages/mail/USE_CASES.md +++ b/packages/mail/USE_CASES.md @@ -698,7 +698,7 @@ $ node index.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. #### Setup your environment variables -Include your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) in `app.yaml`, for example: +Include your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys) in `app.yaml`, for example: ```yaml # Note: Don't commit the app.yaml file with API key, keep it changed locally - only used in deployment @@ -736,7 +736,7 @@ const app = express(); app.get('/send', (req, res) => { const {query: {to = 'test@example.com', from = 'test@example.com'}} = req; // other options could be customized further - + const msg = { to, from, @@ -744,7 +744,7 @@ app.get('/send', (req, res) => { text: 'and easy to do anywhere, even with Node.js', html: 'Hello Email app', }; - + sgMail.send(msg).then(() => { res.status(200).send('Hello, world!').end(); }).catch(e => { @@ -767,11 +767,11 @@ app.listen(PORT, () => { ``` gcloud app deploy ``` - - #### Send email - + + #### Send email + Using the following snippet you should be able to send emails with the deployed app (replace `to` and `from` with your own) - + ```curl curl -X GET \ 'http://your_project_id.appspot.com/send?to=to%40example.com&from=from%40example.com' \