1.0.10 • Published 2 years ago

@novo-x/sendgrid v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago