1.0.14 • Published 3 years ago

@volodymyry/xsine-mailer v1.0.14

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

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);
1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago