{"_id":"@atech/postal","_rev":"2-29aa12314ef8ea09fb3dbef95c88015e","name":"@atech/postal","description":"Node library for open source mail delivery platform, Postal","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@atech/postal","version":"1.0.0","description":"Node library for open source mail delivery platform, Postal","author":{"name":"aTech Media","email":"hello@atech.media"},"license":"MIT","keywords":["postal","mail"],"dependencies":{"concat-stream":"^1.5.2","promise":"^7.1.1"},"gitHead":"5f4b40a40d69b0efdfb42cce4e2e530f879a8346","_id":"@atech/postal@1.0.0","scripts":{},"_shasum":"04f2fc4a656f7c57b5749db54ba7fd02f899312e","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"robertlyall","email":"robert.g.lyall@gmail.com"},"dist":{"shasum":"04f2fc4a656f7c57b5749db54ba7fd02f899312e","tarball":"https://registry.npmjs.org/@atech/postal/-/postal-1.0.0.tgz","integrity":"sha512-l6cbMEemoVWQWKTpVYK3W/jW9UDE2Xe9diwteMLgImnhJym9ecaxHpejqFeh4PJDC99bPbJZqxCBSNZf6LEF/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCF5yrM92jeCOEp27erEjTBKP4YI6j9LZawiwqWZRuFtgIhAIYs4hODYNbkcjA+JAX8O0KIOqtj6eu55CZt7ctAG8ol"}]},"maintainers":[{"name":"robertlyall","email":"robert.g.lyall@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/postal-1.0.0.tgz_1493207777618_0.9030747816432267"}}},"readme":"# Postal for Node\n\nThis library helps you send e-mails through the open source mail delivery\nplatform, [Postal](https://github.com/atech/postal) in Node.\n\n## Installation\n\nInstall the library using [NPM](https://www.npmjs.com/):\n\n```\n$ npm install @atech/postal --save\n```\n\n## Usage\n\nSending an email is very simple. Just follow the example below. Before you can\nbegin, you'll need to login to your installation's web interface and generate\nnew API credentials.\n\n```javascript\n// Include the Postal library\nvar Postal = require('@atech/postal');\n\n// Create a new Postal client using a server key generated using your\n// installation's web interface\nvar client = new Postal.Client('https://postal.yourdomain.com', 'your-api-key');\n\n// Create a new message\nvar message = new Postal.SendMessage(client);\n\n// Add some recipients\nmessage.to('john@example.com');\nmessage.to('mary@example.com');\nmessage.cc('mike@example.com');\nmessage.bcc('secret@awesomeapp.com');\n\n// Specify who the message should be from - this must be from a verified domain\n// on your mail server\nmessage.from('test@test.postal.io');\n\n// Set the subject\nmessage.subject('Hi there!');\n\n// Set the content for the e-mail\nmessage.plainBody('Hello world!');\nmessage.htmlBody('<p>Hello world!</p>');\n\n// Add any custom headers\nmessage.header('X-PHP-Test', 'value');\n\n// Attach any files\nmessage.attach('textmessage.txt', 'text/plain', 'Hello world!');\n\n// Send the message and get the result\nmessage.send()\n  .then(function (result) {\n    var recipients = result.recipients();\n    // Loop through each of the recipients to get the message ID\n    for (var email in recipients) {\n      var message = recipients[email];\n      console.log(message.id());    // Logs the message ID\n      console.log(message.token()); // Logs the message's token\n    }\n  }).catch(function (error) {\n    // Do something with the error\n    console.log(error.code);\n    console.log(error.message);\n  });\n```\n","maintainers":[{"name":"robertlyall","email":"robert.g.lyall@gmail.com"}],"time":{"modified":"2022-06-12T14:49:48.787Z","created":"2017-04-26T11:56:19.534Z","1.0.0":"2017-04-26T11:56:19.534Z"},"keywords":["postal","mail"],"author":{"name":"aTech Media","email":"hello@atech.media"},"license":"MIT","readmeFilename":"README.md"}