🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@opengovsg/postmangovsg-client

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opengovsg/postmangovsg-client

An OpenAPI client and nodemailer transport for postman.gov.sg

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
4
Created
Source

postmangovsg-client

An OpenAPI client and nodemailer transport for postman.gov.sg

Usage

Nodemailer

A custom transport that wraps around the API Client for nodemailer is provided, so that users can send transactional emails using nodemailer's familiar programmatic API

import nodemailer from 'nodemailer'
import { PostmanNodemailerTransport } from '@opengovsg/postmangovsg-client'

const transport = new PostmanNodemailerTransport(process.env.POSTMANGOVSG_API_KEY)
const mailer = nodemailer.createTransport(transport)

const mail = { 
  to: 'team@open.gov.sg', 
  subject: 'Hello World', 
  html: 'Product <b>Launched!</b>',
  // text: 'Product Launched!',
}

mailer.sendMail(mail, (err, info) => {
  if (err) {
    console.error(err, info)
  } else {
    console.log(info)
  }
})

API Client

An OpenAPI client was generated using openapi-generator and the Postman OpenAPI spec. The resulting clients and models are accessible via imports from @opengovsg/postmangovsg-client

FAQs

Package last updated on 04 Aug 2023

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