devercode-sendgrid

Another helpful module for send mail with sendgrid

Usage no npm install needed!

<script type="module">
  import devercodeSendgrid from 'https://cdn.skypack.dev/devercode-sendgrid';
</script>

README

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