🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@appliedblockchain/ab-email

Package Overview
Dependencies
Maintainers
17
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@appliedblockchain/ab-email

Agnostic email service with a Pugntemplate engine

1.0.0
latest
npm
Version published
Weekly downloads
1
-66.67%
Maintainers
17
Weekly downloads
 
Created
Source

Applied Blockchain Email

Description

An email client with template support for emails using HTML. Currently supports Sendgrid (used by default).

Prerequisites

  • Have a Sendgrid account if you're using the sendgrid provider.

Example

const AppliedBlockchainEmail = require('ab-email')

const templates = {
  invite: {
    html: `h1 Hi #{name}
div.container
  p You been invited to join the Applied Blockchain community. Please click here #{link}. `
  },
  otherTemplate: {
    // ...
  }
}

const email = new AppliedBlockchainEmail(templates)

email.invite.send({
    to: 'someone@appliedblockchain.com',
    from: 'invitation@appliedblockchain.com',
    subject: 'You\'ve been invited!',
    html: { 
      name: 'Jane Doe', 
      link: 'your-app.io/invite' 
    }
})

Development

A Mailtrap account is necessary for development.

Make sure linting runs successfully, all tests pass and coverage thresholds are met before committing any changes to the master branch.

Run lint

$ node run lint

Run tests

$ node run test

Check coverage

$ node run coverage

Environment Variables

You can override default configurations by setting these environment variables:

  • AB_EMAIL_PROVIDER: Set Email provider.
  • SENDGRID_API_KEY: Sendgrid api key.

FAQs

Package last updated on 25 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts