node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



deepjs wrapper for nodemailer and postmark.

For transporter config parameters see nodemailer docs.

    // configure default transporter 
        service: "Gmail",
        auth: {
            user: "",
            pass: "userpass"
    deep.mail({ // use default transporter to send email 
        from: "Fred Foo ✔ <>", // sender address 
        to: ",", // list of receivers 
        subject: "Hello ✔", // Subject line 
        text: "Hello world ✔", // plaintext body        
        html: "<b>Hello world ✔</b>" // html body 
    .mail({ // use default transporter to send chain's value(s) (as JSON) through email 
        from: "Fred Foo ✔ <>", // sender address 
        to: ",", // list of receivers 
        subject: "Hello ✔", // Subject line 
        //text: "Hello world ✔ : { value }", // plaintext body       ==> if you provides text here : it will be interpreted with chain's value(s) and used as email body 
        //html: "<b>Hello world ✔ : { value }</b>" // html body      ==> if you provide a template here (i.e. "swig::you-template.html") : it will be used with chain(s value(s) as context. else : it will be interpreted with chain's value(s) 

You could use deep.context to manage contextualised transporter.

    .context("deep-mail-transporter", deep.mail.postmark("YOURAPIKEY"))
        deep.mail({ ... }).log();

deep.mail will first look after a 'deep-mail-transporter' property in deep.context before trying to use the default (general) one.

see deepjs docs on concurrent context management to fully grasp the utility of such manipulation

full API :

deep.mail(params, datas, transporter, closeAfter)...;
// and 
deep(...).mail(params, transporter, closeAfter)...;