# tm-notification

> This is the package exposing methods for the notification service

Latest version **1.0.7** (published 2020-09-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install tm-notification
pnpm add tm-notification
yarn add tm-notification
bun add tm-notification
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2020-09-09 |
| First published | 2020-02-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 14.x |
| Dependencies | 5 |
| Unpacked size | 11.9 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | TM30 |
| Maintainers | tm30tech |
| Keywords | tm-notification, notification, tm, tm30 |

## Links

- npm: https://www.npmjs.com/package/tm-notification
- npm.io page: https://npm.io/package/tm-notification

## Dependencies (5)

- [jest](https://npm.io/package/jest.md) ^24.9.0
- [axios](https://npm.io/package/axios.md) ^0.19.2
- [dotenv](https://npm.io/package/dotenv.md) ^8.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [tm-utils](https://npm.io/package/tm-utils.md) ^0.1.6

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2020-09-09
- 1.0.6 — 2020-08-03
- 1.0.5 — 2020-07-25
- 1.0.4 — 2020-07-22
- 1.0.3 — 2020-07-22
- 1.0.2 — 2020-07-04
- 1.0.1 — 2020-07-02
- 1.0.0 — 2020-06-12
- 0.1.5 — 2020-03-24
- 0.1.4 — 2020-03-24
- 0.1.3 — 2020-02-19
- 0.1.2 — 2020-02-12
- 0.1.1 — 2020-02-07
- 0.1.0 — 2020-02-07

## README

tm-notification
===========
tm-notification - This is the package exposing methods for the notification service

## Installation
```json
"dependencies": {
  "tm-notification": "~1.0.7" // see the "releases" section
}
```
```npm install tm-notification```
## Requirements
- ENV
```dotenv 
APP_NAME=tm-notification-package
API_GATEWAY_URL=
NOTIFICATION_SERVICE_URL= //internal microservice
CLIENT_ID=  
```

###Send SMS
```javascript
const {SMSBuilder} = require('tm-notification');
const smsBuilder = new SMSBuilder();
const builder = smsBuilder.startBuild()
            .setRecipients("0703XXXXXXX")
            .setProvider("smpp")
            .setMessage("Test message")
            .setSender("TM30");

        const response = await builder.send();
        console.log("Response", response);
    //Response { data: 'Email Sent' }

```
### Send Email
- To send Email
```javascript
const {EmailBuilder} = require('tm-notification');
const emailBuilder = new EmailBuilder();
const builder = emailBuilder.startBuild()
    .setProvider("sendgrid")
    .setFrom("package@tm30.net")
    .setSubject("From Test Package")
    .setProvider("sendgrid")
    .setRecipients("michealakinwonmi@gmail.com");

builder.setHeader()
    .setTitle("Header Title")
    // .setBGColor("green")
    .setAppLogo("https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png")
    .setAppUrl("https://tm30.net")
    .setAppName("TM30");


builder.setBody()
    .setContent("This is a content")
    .setGreeting("Greetings,")
    .setIntroLine([
        "intro line 1",
        "intro line 2"
    ])
    .setOutroLine([
        "outroline 1",
        "outroline 2"
    ]);

builder.setAttachments([
    "https://res.cloudinary.com/tm30global/image/upload/v1582900669/4bb79409937716d8db9855e49cc7a9b6.pdf"
]);
const response = await builder.send();
console.log("Response", response); //    Response { data: 'Email Sent' }     




```

### Tests
#### Cli
```bash
npm install
npm test
```

#### Contributors

- [Micheal Akinwonmi](https://github.com/blackhades)

---
_Source: https://npm.io/package/tm-notification · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
