@australis/send-grid-mail
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

utility to easy send mails rendered by react with send-grid from file templates from well known location

--templates/*

Install:

npm i @australis/send-grid-mail

test:

npm run build && npm test

usage:

import { sendMail, renderTemplate } from "@australis/send-grid-mail";
/** 
 * change process.env.MAIL_TEMPLATES_PATH to find them somewhere else 
 * or pass an absoulte path to templateName
 */
async function send(){
    /** "my_mail.js" is waiting in cwd()/templates  */
    const html = renderTemplate(/* templateName: */ "my_mail", { message: "Hi!" });
    await sendMail({
        to: "my@mail.no",
        subject: "Hi There",
        html
    });
}

Dependencies (3)

Dev Dependencies (8)

Package Sidebar

Install

npm i @australis/send-grid-mail

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

7.89 kB

Total Files

12

Last publish

Collaborators

  • d10221