From 691742940c44d1b9acd7add776ed853801f7015f Mon Sep 17 00:00:00 2001 From: Panagiotis Tzamtzis Date: Fri, 23 Sep 2022 17:25:15 +0300 Subject: [PATCH] Add friendly name option to Kitchensink example Extend the kitchen sink example with the use of `name` when defining a friendly name for the sender and/or recipient. --- docs/use-cases/kitchen-sink.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/use-cases/kitchen-sink.md b/docs/use-cases/kitchen-sink.md index dd1dbd299..5461074c5 100644 --- a/docs/use-cases/kitchen-sink.md +++ b/docs/use-cases/kitchen-sink.md @@ -6,10 +6,16 @@ All other options from the [API definition](https://sendgrid.com/docs/API_Refere const sgMail = require('@sendgrid/mail'); sgMail.setApiKey(process.env.SENDGRID_API_KEY); const msg = { - to: 'recipient@example.org', + to: { + name: "Recipient Name", + email: 'recipient@example.org', + }, cc: 'someone@example.org', bcc: ['me@example.org', 'you@example.org'], - from: 'sender@example.org', + from: { + name: "Sender Name", + email: 'sender@example.org', + }, replyTo: 'othersender@example.org', subject: 'Hello world', text: 'Hello plain world!',