Skip to content

Commit

Permalink
Merge f39f475 into 2346c49
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-vr committed Apr 17, 2019
2 parents 2346c49 + f39f475 commit 6100c03
Show file tree
Hide file tree
Showing 44 changed files with 1,944 additions and 2,299 deletions.
Binary file removed .DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion .env.example

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ yarn-error.log
.DS_Store

# env files
.env*
.env
64 changes: 53 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,71 @@

Boilerplate module written in typescript

[![npm version](https://badge.fury.io/js/tree-house-boilerplate.svg)](https://badge.fury.io/js/tree-house-boilerplate)
[![Dependencies](https://david-dm.org/icapps/tree-house-boilerplate.svg)](https://david-dm.org/icapps/tree-house-boilerplate.svg)
[![Build Status](https://travis-ci.org/icapps/tree-house-boilerplate.svg?branch=master)](https://travis-ci.org/icapps/tree-house-boilerplate)
[![Coverage Status](https://coveralls.io/repos/github/icapps/tree-house-boilerplate/badge.svg)](https://coveralls.io/github/icapps/tree-house-boilerplate) [![Greenkeeper badge](https://badges.greenkeeper.io/icapps/tree-house-communication.svg)](https://greenkeeper.io/)
[![npm version](https://badge.fury.io/js/tree-house-communication.svg)](https://badge.fury.io/js/tree-house-communication)
[![Dependencies](https://david-dm.org/icapps/tree-house-communication.svg)](https://david-dm.org/icapps/tree-house-communication.svg)
[![Build Status](https://travis-ci.org/icapps/tree-house-communication.svg?branch=master)](https://travis-ci.org/icapps/tree-house-communication)
[![Coverage Status](https://coveralls.io/repos/github/icapps/tree-house-communication/badge.svg)](https://coveralls.io/github/icapps/tree-house-communication)

## Usage
## General

This module is used to send emails with Mandrill and only template requests (for now).

## Installation

```shell
Clone this project
npm install tree-house-communication
```

```shell
Copy code to new git project, commit and start making your new module
## Usage example

```javascript
import * as emailService from 'tree-house-communication'

// set Mandrill API key
emailService.setMandrillApiKey('secretMandrillKey')

// Create email(s)
const mailInfo : ITemplateRequest = {
templateName: 'icapps-newsletter-template',
subject: 'My subject',
from: { email: 'info@icapps.be', name: 'Info icapps' },
to: [{ email: 'testAddress@gmail.com', name: 'Optional',
content: [{ name: 'greeting', value: 'Hello test!' }] }],
globalContent: [{ name: 'news', value: 'content of big news' }],
};

const extraMandrillOptions = {
async: true,
message: { bcc_address: 'test@gmail.com' }
}

// Send email(s)
const result = await sendEmailWithTemplate(mailInfo, extraMandrillOptions);

// example result
[
{
email: 'email@mail.com',
status: 'queued',
_id: 'e8b9d10ea47e47629d95b22fe200389d'
}, {
email: 'anotherEmail@mail.com',
status: 'queued',
_id: '308274f983f14eb09d266dd9abe51546'
}
]
```

See all [extraMandrillOptions](https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template)

## Tests

You can run `npm run test` to run all tests
You can run `npm run test:coverage` to run all tests with coverage report
- You can run `npm run test` to run all tests
- You can run `npm run test:coverage` to run all tests with coverage report

## Authors

See the list of [contributors](https://github.com/icapps/tree-house-boilerplate/contributors) who participated in this project.
See the list of [contributors](https://github.com/icapps/tree-house-communication/contributors) who participated in this project.

## License

Expand Down
2 changes: 0 additions & 2 deletions build/config/client-config.d.ts

This file was deleted.

13 changes: 0 additions & 13 deletions build/config/client-config.js

This file was deleted.

2 changes: 0 additions & 2 deletions build/index.d.ts

This file was deleted.

7 changes: 0 additions & 7 deletions build/index.js

This file was deleted.

2 changes: 0 additions & 2 deletions build/lib/email.service.d.ts

This file was deleted.

31 changes: 0 additions & 31 deletions build/lib/email.service.js

This file was deleted.

22 changes: 0 additions & 22 deletions build/lib/goodModels/ITemplateRequest.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions build/lib/goodModels/ITemplateRequest.js

This file was deleted.

4 changes: 0 additions & 4 deletions build/lib/models/IMailInfo.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions build/lib/models/IMailInfo.js

This file was deleted.

29 changes: 0 additions & 29 deletions build/lib/models/IMandrilTemplateRequest.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions build/lib/models/IMandrilTemplateRequest.js

This file was deleted.

3 changes: 0 additions & 3 deletions build/mapper/templateMapper.d.ts

This file was deleted.

34 changes: 0 additions & 34 deletions build/mapper/templateMapper.js

This file was deleted.

12 changes: 0 additions & 12 deletions coverage/clover.xml

This file was deleted.

2 changes: 0 additions & 2 deletions coverage/coverage-final.json

This file was deleted.

0 comments on commit 6100c03

Please sign in to comment.