@novo-x/sendgrid
v1.0.10
Published
Sendgrid core
Downloads
24
Readme
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,
"[email protected]" // sender
);
const sent = MyService.sendEmail(
'[email protected]', // 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(
'[email protected]', // 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
);