Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@tshio/mailer-client

Package Overview
Dependencies
Maintainers
5
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tshio/mailer-client

RAD Mailer Client

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
-100%
Maintainers
5
Weekly downloads
 
Created
Source

RAD Mailer Client

npm version

Non-blocking RAD Mailer client for Node.js.

This is a 100% JavaScript library, with TypeScript definition, with the Promise API.

This module makes it simple to implement a Node.js application that uses RAD Mailer.

Table of Contents

Installing

$ npm install @tshio/mailer-client

or

$ yarn add @tshio/mailer-client

Loading and configuration module

// CommonJS
const { MailerClient } = require('@tshio/mailer-client');

// ES Module
import { MailerClient } from '@tshio/mailer-client';


const options = {
  host: "localhost",
  port: "50060",
}

const mailerClient = new MailerClient(options);

Getting started

Send email

const request: SendRequest = {
emails: [
  {
    sender: {
      name: "tsh.io",
      email: "sender@example.com",
    },
    recipient: {
      to: ["recipient@example.com"],
    },
    template: {
      id: "test",
      parameters: {
        firstName: "Antonio",
        lastName: "Hernández",
      },
    },
  },
],
}

await mailerClient.mailer.send(request);

API

mailerClient.mailer.send({ emails, priority }) => Promise< void >

Send emails

Returns void or throw HttpError

Parameters
NameTypeDescriptionDefault
messagesobject[]Array of MailMessage
prioritystringoptional

Send priority, allowed values: urgent, high, medium, low

urgent
Mail message
NameTypeDescriptionDefault
senderobjectSender object
sender.namestringSender name
sender.emailstringSender email
recipientobjectRecipient object
recipient.tostring[]Recipient to
recipient.ccstringoptional

Recipient bcc

recipient.bccstringoptional

Recipient bcc

templateobjectTemplate object
template.idstringTemplate id
template.parametersobjectTemplate parameters
attachmentsobject[]Attachments objects array
attachment.fileNamestringAttachments file name
attachment.contentstringAttachments content encoded with base64

License

license

This project is licensed under the terms of the MIT license.

About us:

The Software House

tsh.png

FAQs

Package last updated on 24 Sep 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