Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ntegral/sendgrid-client

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ntegral/sendgrid-client

Client for the SendGrid v3 Web API

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@ntegral/sendgrid-client

A wrapper for the Twilio SendGrid Client using the SendGrid v3 Web API.

Table Of Contents

  • About
  • Prerequisites
  • Installation
  • Contributing
  • License
  • Acknowledgements

About

A wrapper for the Twilio SendGrid Client using the SendGrid v3 Web API.

Prerequisites

  • Node.js version 8+
  • A Twilio SendGrid Account account, sign up for a free production or development account (https://www.sendgrid.com/)

Installation

npm install --save @ntegral/sendgrid-client @sendgrid/client

Getting Started

The simplest way to use @ntegral/sendgrid-client is as follows:

import { SendGridClient } from "@ntegral/sendgrid-client";

const opts: SendGridClientOptions = {
    apiKey: "--- sendgrid api key ---"
};

let sgc = new SendGridClient(opts);

const mailDynamic: resource.Mail.MailData = {
    personalizations: [
        {
            to: [
                {
                    email: "someone@email.com",
                    name: "Some One"
                }
            ],
            subject: "Sample Subject",
            dynamic_template_data: {
                first_name: "Some",
                last_name: "One"
            }
        }
    ],
    from: {
        email: "hi@fromemail.com",
        name: "Hi Sender"
    },
    template_id: 'SendGrid Dynamic Template Id'
};

sgc.send(mailDynamic).then((result) => {
    console.log('result from send', result);
}).catch((err) => {
    console.log('error from send', err.response.body);
});

Contributing

I would greatly appreciate any contributions to make this project better. Please make sure to follow the below guidelines before getting your hands dirty.

  1. Fork the repository
  2. Create your branch (git checkout -b my-branch)
  3. Commit any changes to your branch
  4. Push your changes to your remote branch
  5. Open a pull request

License

Distributed under the ISC License. See LICENSE for more information.

Acknowledgements

Copyright © 2020 Ntegral Inc.

Keywords

FAQs

Package last updated on 22 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc