Socket
Socket
Sign inDemoInstall

@eucalyptusvc/sendgrid

Package Overview
Dependencies
1
Maintainers
7
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eucalyptusvc/sendgrid

This is a dedicated module for interaction with the mail endpoint of the Sendgrid v3 API.


Version published
Maintainers
7

Readme

Source

@eucalyptusvc/sendgrid

This is a dedicated module for interaction with the mail endpoint of the Sendgrid v3 API.

Install

With yarn:

yarn add @eucalyptusvc/sendgrid

With npm:

npm install @eucalyptusvc/sendgrid

Usage

import { Sendgrid } from '@eucalyptusvc/sendgrid';

const mailer = new Sendgrid({
  brand: 'Pilot',
  apiKey: process.env.SENDGRID_API_KEY,
  email: 'gday@pilot.com.au',
});

const data = {
  email: 'hello@eucalyptus.vc',
  templateId: 'd-xxxxxxxxxxxxxxxx',
  variables: {
    action_url: 'https://eucalyptus.vc',
    firstName: 'Thomas',
  },
};

(async (): Promise<void> => {
  try {
    await mailer.send({
      to: data.email,
      templateId: data.templateId,
      variables: {
        ...data.variables,
      },
    });
  } catch (error) {
    console.error(error.message);
  }
})();

Development

  1. Install dependencies using yarn install or npm install
  2. Start development server using yarn watch

FAQs

Last updated on 12 Oct 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc