{"_id":"trebuchet","_rev":"33-4a9ec169fea33672c749dba13d4eadb6","name":"trebuchet","description":"A node.js module for throwing email around using the Postmark API.","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"trebuchet","version":"0.1.0","description":"A node.js module for throwing email around using the Postmark API.","main":"./index.js","directories":{"lib":"./lib","test":"./test"},"repository":{"type":"git","url":"git://github.com/diy/trebuchet.git"},"keywords":["mail","email","postmark","smtp"],"author":{"name":"DIY, Co.","url":"http://github.com/diy"},"license":"Apache 2.0","dependencies":{"async":"=0.1.18","mu2":"=0.5.13","request":"=2.9.202","underscore":"=1.3.3"},"devDependencies":{"vows":"=0.6.2","optimist":"=0.3.4"},"engine":{"node":">=0.6"},"_npmUser":{"name":"diy","email":"help@diy.org"},"_id":"trebuchet@0.1.0","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.6.12","_defaultsLoaded":true,"dist":{"shasum":"f5e9dd7ddcfe8984adf72753b06139e3740b203a","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-0.1.0.tgz","integrity":"sha512-d2T2kAFF/wytkXmQgt4JQ7VknBEFEv8jBE9e3EBnS/ByXyeDDMM6Nr4SSy/T/ervDNDzittg6w6L/o8BktmrgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfmHmzQY14fj9QptTmBVffsLTPD4FCI89ESi+yRUWysAIgE8cETPoaFdOaudKaMubYqoUByvQcjS90n8gOfL1DCt4="}]},"maintainers":[{"name":"diy","email":"help@diy.org"}]},"0.1.2":{"author":{"name":"DIY, Co.","url":"https://github.com/diy"},"name":"trebuchet","description":"A node.js module for throwing email around using the Postmark API.","version":"0.1.2","homepage":"https://github.com/diy/trebuchet","repository":{"type":"git","url":"git://github.com/diy/trebuchet.git"},"main":"./index","dependencies":{"async":"=0.1.22","mu2":"=0.5.14","request":"=2.9.202","underscore":"=1.3.3"},"devDependencies":{"vows":"=0.6.2","optimist":"=0.3.4"},"optionalDependencies":{},"engines":{"node":">=0.6"},"_npmUser":{"name":"diy","email":"help@diy.org"},"_id":"trebuchet@0.1.2","_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"92ff1375fe884f6b522df4b00bcf07e069036684","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-0.1.2.tgz","integrity":"sha512-UQNB5Il/1NNXSqc29ykkjuEiY7DCY2lSvNg6OcUjDd8YePhDfiCeIIpiVCU7ugIKvCLPXC5EvPDR4DLH2za7Tg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7tSZK3VN6zQ86kj35G8oXkIrs+NC//tT7UH6Zb739kAiEAkABIKN13/29fbNMG6nH2ZPJzoL7KXeYNVlUM98DunFY="}]},"maintainers":[{"name":"diy","email":"help@diy.org"}],"directories":{}},"0.1.1":{"author":{"name":"DIY, Co.","url":"https://github.com/diy"},"name":"trebuchet","description":"A node.js module for throwing email around using the Postmark API.","version":"0.1.1","homepage":"https://github.com/diy/trebuchet","repository":{"type":"git","url":"git://github.com/diy/trebuchet.git"},"main":"./index","dependencies":{"async":"=0.1.22","mu2":"=0.5.14","request":"=2.9.202","underscore":"=1.3.3"},"devDependencies":{"vows":"=0.6.2","optimist":"=0.3.4"},"optionalDependencies":{},"engines":{"node":">=0.6"},"_npmUser":{"name":"diy","email":"help@diy.org"},"_id":"trebuchet@0.1.1","_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"8c708b6e8c9ad071251b94c5be62e3ae1cb0e1e7","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-0.1.1.tgz","integrity":"sha512-duA+63RBLAZtfjb0X+ufcLIs4Qyh9t9Luh3U50nEig9t/chOyBM6IrBOTOm1NH+4wzsPioEOQxOLfU8rdtWeXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEPHT6Z/l8V/NyafPP7NYan8YZka+9kTYhn8mN/gErAAiEApI9qkP8IexZiL9oKpAXk8vLdVA7Rx2DJ0G4Ffn40Arg="}]},"maintainers":[{"name":"diy","email":"help@diy.org"}],"directories":{}},"0.2.0":{"name":"trebuchet","version":"0.2.0","description":"A node.js module for throwing email around using the Postmark API.","main":"./lib/index.js","directories":{"lib":"./lib","test":"./test"},"repository":{"type":"git","url":"git://github.com/diy/trebuchet.git"},"keywords":["mail","email","postmark","smtp"],"author":{"name":"DIY, Co.","url":"http://github.com/diy"},"license":"Apache 2.0","dependencies":{"async":"=0.1.18","mu2":"=0.5.13","request":"=2.9.202","underscore":"=1.3.3","juice":"https://github.com/niftylettuce/juice/tarball/master"},"devDependencies":{"vows":"=0.6.2","optimist":"=0.3.4"},"engine":{"node":">=0.6"},"_npmUser":{"name":"diy","email":"help@diy.org"},"_id":"trebuchet@0.2.0","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"f4dd7da716d5ef224200b1a55307a1d4a7f2b51e","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-0.2.0.tgz","integrity":"sha512-MilcJMkwBJ7fB9p8KW//l/wyNsDAkDFx7G2ahgPQ0SsgEjs2CTZrCSyerEd3S+kyfXhZWabBBtSQMYB7wW4uHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhRVGRG164tkOAhW+HeuB5k1fjlhf1Gl9v2gbsHdSK1AiBKiz6nLyHSjD/Cw1sJCA+aVUxBu41UUx4LFx0s8TFTlw=="}]},"maintainers":[{"name":"diy","email":"help@diy.org"}]},"0.3.0":{"name":"trebuchet","version":"0.3.0","description":"A node.js module for throwing email around using the Postmark API.","main":"./lib/index.js","scripts":{"test":"node ./test/index.js --from nyan@domain.com --to cat@domain.com"},"repository":{"type":"git","url":"git://github.com/diy/trebuchet.git"},"keywords":["mail","email","postmark","mustache","juice","template"],"author":{"name":"DIY, Co.","url":"https://github.com/diy"},"license":"Apache 2.0","dependencies":{"async":"0.1.X","mu2":"0.5.X","request":"2.9.X","underscore":"1.3.X","juice":"https://github.com/niftylettuce/juice/tarball/master"},"devDependencies":{"tap":"0.3.X","optimist":"=0.3.4"},"engine":{"node":">=0.6"},"_npmUser":{"name":"diy","email":"help@diy.org"},"_id":"trebuchet@0.3.0","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"6b2beeecb4c091d4f01ab97ba8b3b33a98690120","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-0.3.0.tgz","integrity":"sha512-L6NnAMf99e8SWUuydi26DbYs3Ah4oVpJuoSy2hBPSdYRIHxln9wTcEhrpOy2q/csCC554OPDSwr2K55ltzcTnw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICfq1AUHCrDQLNORpUsZjLSd4KuIMzexQLxUcxLFC7KoAiAXW5F5eSMJCeuawU6no99Zr3DWpUud8u1oHRRoo/X1Qw=="}]},"maintainers":[{"name":"diy","email":"help@diy.org"}],"directories":{}},"0.3.1":{"name":"trebuchet","version":"0.3.1","description":"A node.js module for throwing email around using the Postmark API.","main":"./lib/index.js","scripts":{"test":"node ./test/index.js --from nyan@domain.com --to cat@domain.com"},"repository":{"type":"git","url":"git://github.com/thisandagain/trebuchet.git"},"keywords":["mail","email","postmark","mustache","juice","template"],"author":{"name":"DIY, Co.","url":"https://github.com/diy"},"license":"Apache 2.0","dependencies":{"async":"0.1.X","mu2":"0.5.X","request":"2.9.X","underscore":"1.3.X","juice":"https://github.com/niftylettuce/juice/tarball/master"},"devDependencies":{"tap":"0.3.X","optimist":"=0.3.4"},"engine":{"node":">=0.6"},"_npmUser":{"name":"diy","email":"help@diy.org"},"_id":"trebuchet@0.3.1","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"1202ab03aba23a2016a6ae670f05c2c14a431296","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-0.3.1.tgz","integrity":"sha512-4eYZMHTmNHe57bMabIc9sPkLEX937YnHYOR6bqSU4Z6KbZmOKu5ex+ewFJTTRfhR1aO+6oXV+pna+e1Yoa81XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDO6qc3n2sVBaRvp0vbit+so0ZmznwlqHiBVH2oqyvJzQIhAO0nbgr4gdqrgLRQRezrH91It61DJk8KudP8AosnshdF"}]},"maintainers":[{"name":"diy","email":"help@diy.org"}],"directories":{}},"1.0.0":{"name":"trebuchet","version":"1.0.0","description":"A node.js module for throwing email around using the Postmark API.","main":"./lib/index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"http://github.com/thisandagain/trebuchet.git"},"keywords":["mail","email","postmark","mustache","juice","template"],"author":{"name":"Andrew Sliwinski","email":"andrew@diy.org"},"contributors":[{"name":"Nick Baugh","email":"niftylettuce@gmail.com"}],"license":"Apache 2.0","dependencies":{"juice":"~0.2.0","mu2":"~0.5.17","request":"~2.14.0","underscore":"~1.4.4"},"devDependencies":{"codebux":"~0.1.2","tap":"~0.4.0"},"engine":{"node":">=0.8"},"readme":"# Trebuchet\n\n#### Let's chuck some email!\n\nTrebuchet is a node.js module for super simple email transactions using the [Postmark API](http://postmarkapp.com) and [Mustache](http://mustache.github.com/) with [Juice](https://github.com/LearnBoost/juice) for templating. Trebuchet was designed with simple email rendering, batching and API operations in mind.\n\n[![Build Status](https://secure.travis-ci.org/thisandagain/trebuchet.png?branch=master)](http://travis-ci.org/thisandagain/trebuchet)\n\n## Installation\n\n```bash\nnpm install trebuchet\n```\n\n## Basic Use (Fling Pattern)\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the fling pattern'\n    },\n    html: __dirname + '/path/to/template/fling.html',\n    text: __dirname + '/path/to/template/fling.txt',\n    data: {\n        foo: 'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n```\n\n## Basic Use (Fling Pattern with HTML friendly inlined-CSS support)\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the fling pattern'\n    },\n    html: __dirname + '/path/to/template/fling.html',\n    css: __dirname + '/path/to/template/fling.css',\n    text: __dirname + '/path/to/template/fling.txt',\n    data: {\n        foo: 'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n```\n\n## Batch Sender (Load --> Fire Pattern)\n\nThe batch sender uses the [Postmark API's batch method](http://developer.postmarkapp.com/developer-build.html#batching-messages) to support sending groups of messages (up to 500 at a time).\n\n**NOTE**: You can also pass a css variable to load a stylesheet that will be inlined using `juice`.\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.load({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the load/fire pattern'\n    },\n    html: __dirname + '/path/to/template/fire.html',\n    text: __dirname + '/path/to/template/fire.txt',\n    data: {\n        foo: 'Bar',\n        name: 'Bubba'\n    }\n}, function (err, response) {\n    // Loaded!\n});\n```\n\n```javascript\ntrebuchet.fire(function (err, response) {\n    // Win!\n});\n```\n\n## Templating\n\nTrebuchet uses [Mustache](http://mustache.github.com/) templates to make sending dynamic HTML and plain-text emails super-duper simple.\n\n**NEW**: We've added support [Juice](https://github.com/LearnBoost/juice) which allows one to pass a `css` variable and inline the CSS with the HTML template for email-friendly CSS... KA POW!\n\nAn example template:\n\n```html\n<html>\n    <body>\n        <h1>{{greeting}}</h1>\n    </body>\n</html>\n```\n\nWith example data:\n\n```javascript\n{\n    greeting: 'Hello World!'\n}\n```\n\nResult (without CSS argument):\n\n```html\n<html>\n    <body>\n        <h1>Hello World!</h1>\n    </body>\n</html>\n```\n\nResult (with CSS argument, e.g. \"some/path/to/template.css\"):\n\n```html\n<html>\n    <body style=\"color:yellow;background-color:black;\">\n        <h1>Hello World!</h1>\n    </body>\n</html>\n```\n\n## Testing\n\n```bash\nnpm test\n```","_id":"trebuchet@1.0.0","dist":{"shasum":"b0d5b934a58fcb9ee31c29b47ff71c3c3423cb0c","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-1.0.0.tgz","integrity":"sha512-WtaL50uddpl/NCJ3+rjtyiMkkT8375/NlLlupubWALbuWbphzpBzHS7j+Zg/B5ZnGDfu7b49cSlb/xfhEYJIPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoU6YTx9PSkTSIDoNzjUKOsI2cmHFNm/5ArreV7igSPAiEAgmRpkCaw1NqrMot+4hcgzIYCLgbS4gwEcYTmG1zjRhA="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"diy","email":"help@diy.org"},"maintainers":[{"name":"diy","email":"help@diy.org"}],"directories":{}},"1.0.1":{"name":"trebuchet","version":"1.0.1","description":"A node.js module for throwing email around using the Postmark API.","main":"./lib/index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"http://github.com/thisandagain/trebuchet.git"},"keywords":["mail","email","postmark","mustache","juice","template"],"author":{"name":"Andrew Sliwinski","email":"andrew@diy.org"},"contributors":[{"name":"Nick Baugh","email":"niftylettuce@gmail.com"}],"license":"Apache 2.0","dependencies":{"juice":"~0.3.2","mu2":"~0.5.17","request":"~2.14.0","underscore":"~1.4.4"},"devDependencies":{"codebux":"~0.1.2","tap":"~0.4.0"},"engine":{"node":">=0.8"},"readme":"# Trebuchet\n\n#### Let's chuck some email!\n\nTrebuchet is a node.js module for super simple email transactions using the [Postmark API](http://postmarkapp.com) and [Mustache](http://mustache.github.com/) with [Juice](https://github.com/LearnBoost/juice) for templating. Trebuchet was designed with simple email rendering, batching and API operations in mind.\n\n[![Build Status](https://secure.travis-ci.org/thisandagain/trebuchet.png?branch=master)](http://travis-ci.org/thisandagain/trebuchet)\n\n## Installation\n\n```bash\nnpm install trebuchet\n```\n\n## Basic Use (Fling Pattern)\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the fling pattern'\n    },\n    html: __dirname + '/path/to/template/fling.html',\n    text: __dirname + '/path/to/template/fling.txt',\n    data: {\n        foo: 'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n```\n\n## Basic Use (Fling Pattern with HTML friendly inlined-CSS support)\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the fling pattern'\n    },\n    html: __dirname + '/path/to/template/fling.html',\n    css: __dirname + '/path/to/template/fling.css',\n    text: __dirname + '/path/to/template/fling.txt',\n    data: {\n        foo: 'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n```\n\n## Batch Sender (Load --> Fire Pattern)\n\nThe batch sender uses the [Postmark API's batch method](http://developer.postmarkapp.com/developer-build.html#batching-messages) to support sending groups of messages (up to 500 at a time).\n\n**NOTE**: You can also pass a css variable to load a stylesheet that will be inlined using `juice`.\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.load({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the load/fire pattern'\n    },\n    html: __dirname + '/path/to/template/fire.html',\n    text: __dirname + '/path/to/template/fire.txt',\n    data: {\n        foo: 'Bar',\n        name: 'Bubba'\n    }\n}, function (err, response) {\n    // Loaded!\n});\n```\n\n```javascript\ntrebuchet.fire(function (err, response) {\n    // Win!\n});\n```\n\n## Templating\n\nTrebuchet uses [Mustache](http://mustache.github.com/) templates to make sending dynamic HTML and plain-text emails super-duper simple.\n\n**NEW**: We've added support [Juice](https://github.com/LearnBoost/juice) which allows one to pass a `css` variable and inline the CSS with the HTML template for email-friendly CSS... KA POW!\n\nAn example template:\n\n```html\n<html>\n    <body>\n        <h1>{{greeting}}</h1>\n    </body>\n</html>\n```\n\nWith example data:\n\n```javascript\n{\n    greeting: 'Hello World!'\n}\n```\n\nResult (without CSS argument):\n\n```html\n<html>\n    <body>\n        <h1>Hello World!</h1>\n    </body>\n</html>\n```\n\nResult (with CSS argument, e.g. \"some/path/to/template.css\"):\n\n```html\n<html>\n    <body style=\"color:yellow;background-color:black;\">\n        <h1>Hello World!</h1>\n    </body>\n</html>\n```\n\n## Testing\n\n```bash\nnpm test\n```","_id":"trebuchet@1.0.1","dist":{"shasum":"ae75c8d7d1e4ec1680d5b9dfec4a65183912a240","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-1.0.1.tgz","integrity":"sha512-DzWguqEmZtx5306Q7UuByOackden0jhyn1yzzDX9BxU3VrW5tQj51g2bTnknoDLcANxGQB0fV5y20AIgQ54T2w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpI9xHt6K3pCjB+lO7XMm+FtbH5qRKnvSdbt+OV6Jq8AIgKL7U+Lq8/WZc9PPo4fOJM7rMsQjrVyT59EZ1Jn+Hz4E="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"diy","email":"help@diy.org"},"maintainers":[{"name":"diy","email":"help@diy.org"}],"directories":{}},"1.1.0":{"name":"trebuchet","version":"1.1.0","description":"A node.js module for throwing email around using the Postmark API.","main":"./lib/index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"http://github.com/thisandagain/trebuchet.git"},"keywords":["mail","email","postmark","mustache","juice","template"],"author":{"name":"Andrew Sliwinski","email":"andrew@diy.org"},"contributors":[{"name":"Nick Baugh","email":"niftylettuce@gmail.com"}],"license":"Apache 2.0","dependencies":{"juice":"~0.3.2","mu2":"~0.5.17","request":"~2.14.0","underscore":"~1.4.4"},"devDependencies":{"codebux":"~0.1.2","tap":"~0.4.0"},"engine":{"node":">=0.8"},"readme":"# Trebuchet\n\n#### Let's chuck some email!\n\nTrebuchet is a node.js module for super simple email transactions using the [Postmark API](http://postmarkapp.com) and [Mustache](http://mustache.github.com/) with [Juice](https://github.com/LearnBoost/juice) for templating. Trebuchet was designed with simple email rendering, batching and API operations in mind.\n\n[![Build Status](https://secure.travis-ci.org/thisandagain/trebuchet.png?branch=master)](http://travis-ci.org/thisandagain/trebuchet)\n\n## Installation\n\n```bash\nnpm install trebuchet\n```\n\n## Basic Use (Fling Pattern)\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the fling pattern'\n    },\n    html: __dirname + '/path/to/template/fling.html',\n    text: __dirname + '/path/to/template/fling.txt',\n    data: {\n        foo: 'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n```\n\n## Basic Use (Fling Pattern with HTML friendly inlined-CSS support)\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the fling pattern'\n    },\n    html: __dirname + '/path/to/template/fling.html',\n    css: __dirname + '/path/to/template/fling.css',\n    text: __dirname + '/path/to/template/fling.txt',\n    data: {\n        foo: 'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n```\n\n## Batch Sender (Load --> Fire Pattern)\n\nThe batch sender uses the [Postmark API's batch method](http://developer.postmarkapp.com/developer-build.html#batching-messages) to support sending groups of messages (up to 500 at a time).\n\n**NOTE**: You can also pass a css variable to load a stylesheet that will be inlined using `juice`.\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.load({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'This is only a test of the load/fire pattern'\n    },\n    html: __dirname + '/path/to/template/fire.html',\n    text: __dirname + '/path/to/template/fire.txt',\n    data: {\n        foo: 'Bar',\n        name: 'Bubba'\n    }\n}, function (err, response) {\n    // Loaded!\n});\n```\n\n```javascript\ntrebuchet.fire(function (err, response) {\n    // Win!\n});\n```\n\n## Templating\n\nTrebuchet uses [Mustache](http://mustache.github.com/) templates to make sending dynamic HTML and plain-text emails super-duper simple.\n\n**NEW**: We've added support [Juice](https://github.com/LearnBoost/juice) which allows one to pass a `css` variable and inline the CSS with the HTML template for email-friendly CSS... KA POW!\n\nAn example template:\n\n```html\n<html>\n    <body>\n        <h1>{{greeting}}</h1>\n    </body>\n</html>\n```\n\nWith example data:\n\n```javascript\n{\n    greeting: 'Hello World!'\n}\n```\n\nResult (without CSS argument):\n\n```html\n<html>\n    <body>\n        <h1>Hello World!</h1>\n    </body>\n</html>\n```\n\nResult (with CSS argument, e.g. \"some/path/to/template.css\"):\n\n```html\n<html>\n    <body style=\"color:yellow;background-color:black;\">\n        <h1>Hello World!</h1>\n    </body>\n</html>\n```\n\n## Pre-rendered content\n\nTrebuchet also accepts pre-rendered strings and buffers. Simply add the prerendered flag and ommit the data in your options.\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.load({\n    params: {\n        from: 'you@domain.com',\n        to: 'someone@domain.com',\n        subject: 'Sending email using prerendred texts'\n    },\n    prerendered: true,\n    html: '<h2>This email was rendered externally!</h2>', //alternatively, pass in a buffer\n    text: 'This email was rendered externally!',\n}, function (err, response) {\n    // Loaded!\n});\n```\n\n## Testing\n\n```bash\nnpm test\n```","readmeFilename":"README.md","_id":"trebuchet@1.1.0","dist":{"shasum":"32fbee68df370c158f74c4bc20ded962b9bfa490","tarball":"https://registry.npmjs.org/trebuchet/-/trebuchet-1.1.0.tgz","integrity":"sha512-aBdeTxxNosiicieAphPz6l2WBAClV+j91gDmwMuP/52W5pAUFxEiMMbYbdHJzirJFT/5SvqMdrY2lTR4EQJWYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC16BnCW3fG2d5GvdfmEY8C+JSHJx52gjKdnJd7bz2cswIgVBTaRSSK2LYcfhfxFFcMTX030r+hfm4bDHa5GGNcBJE="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"diy","email":"help@diy.org"},"maintainers":[{"name":"diy","email":"help@diy.org"}]}},"readme":"# Trebuchet\n#### Let's chuck some email!\n\nTrebuchet is a node.js module for super simple email transactions using the [Postmark API](http://postmarkapp.com) and [Mustache](http://mustache.github.com/) for templating. Trebuchet was designed with simple email rendering, batching and API operations in mind.\n\n## Installation\n    npm install trebuchet\n\n## Templating\nTrebuchet uses [Mustache](http://mustache.github.com/) templates to make sending dynamic HTML and plain-text emails super-duper simple. \n\nAn example template:\n```html\n<html>\n    <body>\n        <h1>{{greeting}}</h1>\n    </body>\n</html>\n````\n\nWith example data:\n```javascript\n{\n    greeting: 'Hello World!'\n}\n````\n\nResult:\n```html\n<html>\n    <body>\n        <h1>Hello World!</h1>\n    </body>\n</html>\n````\n\n## Basic Use (Fling Pattern)\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.fling({\n    params:     {\n        from:       'you@domain.com',\n        to:         'someone@domain.com',\n        subject:    'This is only a test of the fling pattern'\n    },\n    html:       'path/to/template/fling.html',\n    text:       'path/to/template/fling.txt',\n    data:       {\n        foo:        'Bar'\n    }\n}, function (err, response) {\n    // Win!\n});\n````\n\n## Batch Sender (Load --> Fire Pattern)\nThe batch sender uses the [Postmark API's batch method](http://developer.postmarkapp.com/developer-build.html#batching-messages) to support sending groups of messages (up to 500 at a time).\n\n```javascript\nvar trebuchet = require('trebuchet')('yourapikey');\n\ntrebuchet.load({\n    params:     {\n        from:       'you@domain.com',\n        to:         'someone@domain.com',\n        subject:    'This is only a test of the load/fire pattern'\n    },\n    html:       'path/to/template/fire.html',\n    text:       'path/to/template/fire.txt',\n    data:       {\n        foo:        'Bar',\n        name:       'Bubba'\n    }\n}, function (err, response) {\n    // Loaded!\n});\n````\n\n```javascript\ntrebuchet.fire(function (err, response) {\n    // Win! \n});\n````\n\n## Testing\n    node test/* --from \"you@domain.com\" --to \"someone@domain.com\"","maintainers":[{"name":"diy","email":"help@diy.org"}],"time":{"modified":"2022-06-27T20:46:34.882Z","created":"2012-05-07T01:57:00.717Z","0.1.0":"2012-05-07T01:57:02.183Z","0.1.1":"2012-06-17T01:12:49.913Z","0.1.2":"2012-06-17T01:11:49.892Z","0.2.0":"2012-06-17T04:51:31.299Z","0.3.0":"2012-08-03T01:24:47.408Z","0.3.1":"2012-08-03T01:44:40.260Z","1.0.0":"2013-03-14T19:20:22.710Z","1.0.1":"2013-03-28T04:08:08.258Z","1.1.0":"2013-09-13T23:03:22.912Z"},"author":{"name":"Andrew Sliwinski","email":"andrew@diy.org"},"repository":{"type":"git","url":"http://github.com/thisandagain/trebuchet.git"}}