8.0.2 • Published 2 years ago

@kohanajs/mod-mail v8.0.2

Weekly downloads
5
License
MIT
Repository
gitlab
Last release
2 years ago

kohanajs-mod-mail

Module for Transactional email

##install npm i @kohanajs/mod-mail

this will install Mail Object with default adapter for preview

add require("@kohanajs/mod-mail"); to application/require.js to load default config file and default routes.

##usage

const {Mail} = require('@kohanajs/mod-mail');

const mail = new Mail({
  domain:'localhost',
  ip:'127.0.0.1'
});
await mail.send('this is subject', 'this is body text', 'sender@kohanajs.com', 'recipient@example.com')

###templates

const mail = new Mail({
  domain:'localhost',
  ip:'127.0.0.1'
  templateFolder: `${__dirname}/edm`
});

const result = await mail.send('subject', 'test.txt', 'TEST', '20221234', {
  html:'test.html',
  tokens: {'message': 'hello world'},
});

//result.payload.text
//result.payload.html

###only html template

const mail = new Mail({
  domain:'localhost',
  ip:'127.0.0.1'
  templateFolder: new Map([
    ['html', `${__dirname}/edm`]
  ])
});

const result = await mail.send('subject', 'hello {{@message}}', 'TEST', '20221234', {
  html:'test.html',
  tokens: {'message': 'hello world'},
});

//result.payload.text
//result.payload.html

###template use handle (WIP)

const mail = new Mail({
  domain:'localhost',
  ip:'127.0.0.1'
  templateFolder: '@edm'
});

const result = await mail.send('subject', 'test::text', 'TEST', '20221234', {
  html:'test::html',
  tokens: {'message': 'hello world'},
});
8.0.2

2 years ago

8.0.1

2 years ago

7.0.0

2 years ago

8.0.0

2 years ago

5.1.0

2 years ago

6.1.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

6.0.3

2 years ago

6.1.1

2 years ago

6.0.2

2 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.1.0

4 years ago

4.2.0

4 years ago

4.1.1

4 years ago

4.0.2

4 years ago

4.0.1

4 years ago

4.0.0

4 years ago

3.7.1

4 years ago

3.7.0

4 years ago

3.6.1

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago