@volodymyry/xsine-mailer
TypeScript icon, indicating that this package has built-in type declarations

1.0.14 • Public • Published

concured-modules-library

NPM package for our modules that will be reused in multiple part of the code.

List of modules

  • Mailer
  • ...

Publish to NPM

  • change a version of the library in package.json
  • npm run build
  • npm publish
  • npm publish --access=public - for public access

Use and Setup

To install the library use the following command

npm install --save @volodymyry/xsine-mailer

Mailer module

Important The module supports only SMTP connection at the moment

The mailer can be declared globally as a singleton.

The Mailer class has a private constructor, use specific (only SMTP enabled for now) builders to initialize the instance

import {Mailer} from "@volodymyry/xsine-mailer";


mailer = new Mailer.SMTPMailerBuilder()
        .setSenderName("Concured")
        .setSenderMail("support@concured.com")
        .setOptions({
            service: "gmail",
            auth: {
                type: "",
                user: '',
                clientId: '',
                clientSecret: '',
                refreshToken: '',
                accessToken: ''
            }

        }).build();

  • setSenderName() - not required. default: "support@concured.com"
  • setSenderName() - not required. default: Concured
  • setOptions() - see SMTPTransport.Options interface

Sending emails:

  • signup:
const context = {
                    to: "",
                    context: {
                        confirmEmailUrl: "",
                        name: ""
                    }
                };


mailer.sendEmailConfirmationMail(context);
  • reset-password:
const context = {
                    to: "",
                    context: {
                        resetPasswordUrl: "",
                        name: ""
                    }
                };


mailer.sendResetPasswordMail(context);

Readme

Keywords

none

Package Sidebar

Install

npm i @volodymyry/xsine-mailer

Weekly Downloads

16

Version

1.0.14

License

none

Unpacked Size

266 kB

Total Files

27

Last publish

Collaborators

  • volodymyry