JSPM

@envialosimple/transaccional

1.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25
  • Score
    100M100P100Q57429F
  • License MIT

Node.js SDK for EnvíaloSimple Transaccional

Package Exports

  • @envialosimple/transaccional
  • @envialosimple/transaccional/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@envialosimple/transaccional) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

EnvíaloSimple Transaccional - Node.js SDK

Requirements

Installation

npm install @envialosimple/transaccional

Basic Usage

import { Transaccional, MailParams } from "@envialosimple/transaccional";

const estr = new Transaccional(your_api_key);
const params = new MailParams();

params
    .setFrom('no-reply@mycompany.com', 'MyCompany Notifications')
    .setTo('john.doe@example.com', 'John Doe')
    .setReplyTo('reply@here.com')
    .setSubject('This is a test for {{name}}')
    .setPreviewText('A glimpse of what comes next...')
    .setHtml('<h1>HTML emails are cool, {{name}}</h1>')
    .setText('Text emails are also cool, {{name}}')
    .setContext({name: 'John'});


await estr.mail.send(params);

Multiple Recipients Usage

import { Transaccional, MailParams } from "@envialosimple/transaccional";

const estr = new Transaccional(your_api_key);
const params = new MailParams();

params
    .setFrom('no-reply@mycompany.com', 'MyCompany Notifications')
    .setTo([
      {email: 'john.doe@example.com', name: 'John Doe'},
      {email: 'jane.doe@example.com', name: 'Jane Doe'},
      {email: 'sean.doe@example.com'},
    ])
    .setReplyTo('reply@here.com')
    .setSubject('This is a test for {{name}}')
    .setPreviewText('A glimpse of what comes next...')
    .setHtml('<h1>HTML emails are cool, {{name}}</h1>')
    .setText('Text emails are also cool, {{name}}')
    .setContext({name: 'John'});


await estr.mail.send(params);