devercode-sendgrid
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Devercode-Sendgrid

Another helpful module for send mail with sendgrid

Authors

Installation

  npm install devercode-sendgrid
  yarn add devercode-sendgrid

Features

  • Sendgrid support
  • MJML and Handlebars support

Usage

  • Send mail with html
import { createClient } from "~@/index";
const client = createClient({
  apiKey: "SG.key",
});
client.send({
  from: "support@example.com",
  to: "any@example.com",
  html: `
      <h1>Hello world</h1>
    `,
  subject: "Testing",
});
  • Send mail with mjml
import { createClient } from "~@/index";
const client = createClient({
  apiKey: "SG.key",
});
client
  .sendWithMjml({
    path: path.join(__dirname, "../__fixtures__/template.mjml"),
    from: "help@thebugbunny.com",
    meta: {
      name: "thinh",
    },
    subject: "Test Message",
    to: "deverpham@gmail.com",
  })
  .catch((err) => {
    console.log(err.response.body);
  });

License

MIT

Support

For support, email devercode@gmail.com

Readme

Keywords

Package Sidebar

Install

npm i devercode-sendgrid

Weekly Downloads

3

Version

1.0.0

License

none

Unpacked Size

12.7 kB

Total Files

19

Last publish

Collaborators

  • devercode