@novo-x/sendgrid
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

Sendgrid Service

Available methods

  • sendEmail: sends an email

Usage examples

yarn add @novo-x/sendgrid

import {Sendgrid} from "@novo-x/sendgrid"

const MyService = new Sendgrid(
    '123456789', // apiKey,
    "from@email.com" // sender
);

const sent = MyService.sendEmail(
    'to@email.com', // Receiver,
    '123456789', // Template id
    { someField: someValue }, // Optional data to be replaced in the template
    { someField: someValue }, // Optional headers
    { someField: someValue }, // Optional extra config
);

const sent = MyService.sendEmailWithAttachmebt(
    'to@email.com', // Receiver,
    '123456789', // Template id
    'ASJKDHASKLDJKAKSJDKAJSD9283', // File stream
    {  // File metadata
        filename: 'my_file.pdf', // File name
        contentType: 'application/pdf' // File content type
    },
    { someField: someValue }, // Optional data to be replaced in the template
    { someField: someValue }, // Optional headers
    { someField: someValue }, // Optional extra config
    
);

Dependencies

@sendgrid/mail

Package Sidebar

Install

npm i @novo-x/sendgrid

Weekly Downloads

0

Version

1.0.10

License

ISC

Unpacked Size

26.3 kB

Total Files

6

Last publish

Collaborators

  • lautarobruno
  • agustin-novolabs
  • novo-tincho
  • nicolas.novolabs
  • mati-novolabs
  • alejitowow
  • nahuelprieto