Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@salestrip/emailer

Package Overview
Dependencies
Maintainers
6
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salestrip/emailer

Send emails with attachments

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
162
increased by7.28%
Maintainers
6
Weekly downloads
 
Created
Source

@salestrip/emailer

SalesTrip Engine emailer library

Sends emails with optional attachments that are base64 string encoded.

Instructions

npm i @salestrip/emailer

Usage

Required fields

const emailer = require('@salestrip/emailer')

exports.send = function() {
  const payload = {
    kind: EMAIL_KINDS_ENUM,
    to: 'customer@salestrip.com', // only one recipient
    subject: STRING,
    model: {}
  }
  return emailer.create(payload)
}

Optional fields

If attachments are included then the specified fields are required. Sendgrid does not document how many attachments can be sent so as a precaution only 2 attachments can be sent.

const emailer = require('@salestrip/emailer')

exports.send = function() {
  const payload = {
    kind: EMAIL_KINDS_ENUM,
    to: 'customer@salestrip.com',
    cc: ['another@email.com'],
    bcc: ['another@email.com'],
    from: 'engineering@salestrip.com', // defaults to no-reply@salestrip.com
    subject: STRING,
    model: {},
    attachments: [
      {
        type: 'application/pdf',
        filename: 'my-file.pdf',
        content: 'base64 encoded string'
      }
    ]
  }
  return emailer.create(payload)
}

Release

To release a new version, use npm. Using npm version will update the version in package.json before committing the resulting file change to git and adding the appropriate git tag. Pushing a tagged version to origin will trigger a CI deployment to the npm registry.

To release a bugfix update the patch version.

npm version patch
git push
git push --tags

To release a feature update the minor version.

npm version minor
git push
git push --tags

To release a breaking change update the major version.

npm version major
git push
git push --tags

License

Copyright © 2018-2020 SalesTrip Limited. All rights reserved.

FAQs

Package last updated on 14 May 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc