loopback-connector-sendmail

0.0.2 • Public • Published

loopback-connector-sendmail

Loopback connector module which allow to send emails via sendmail.

1. Installation

npm install loopback-connector-sendmail --save

2. Configuration

datasources.json

{
    "sendmail": {
        "connector": "loopback-connector-sendmail",
        "silent": false
    }
}

model-config.json

{
    "Email": {
        "dataSource": "sendmail",
        "public": false
    }
}

3. Use

Basic option same as built in Loopback. Returns a Promise

loopback.Email.send({
    to: "to@to.com",
    from: "fron@from.com",
    subject: "subject",
    text: "text message",
    html: "html <b>message</b>",
    var : {
        myVar1 : 'a custom value'
    },
    headers : {
        "X-My-Header" : "My Custom header"
    }
})
.then(function(response){})
.catch(function(err){});

Package Sidebar

Install

npm i loopback-connector-sendmail

Weekly Downloads

4

Version

0.0.2

License

MIT

Last publish

Collaborators

  • hephaistionn