Socket
Socket
Sign inDemoInstall

@appliedblockchain/ab-email

Package Overview
Dependencies
148
Maintainers
17
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @appliedblockchain/ab-email

Agnostic email service with a Pugntemplate engine


Version published
Weekly downloads
1
Maintainers
17
Install size
16.1 MB
Created
Weekly downloads
 

Readme

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

Last updated on 25 Jun 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc