# messagebus

> A client for the Message Bus REST API - Version 5

Latest version **5.0.0** (published 2014-03-03) · 0 weekly downloads

## Install

```sh
npm install messagebus
pnpm add messagebus
yarn add messagebus
bun add messagebus
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2014-03-03 |
| First published | 2012-12-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+7 in 3 direct dependencies) |
| Install scripts | no |
| Maintainers | thesmart, messagebus |
| Keywords | Message Bus, messagebus, email, messagebus client, messagebus api, messagebus email |

## Links

- npm: https://www.npmjs.com/package/messagebus
- Repository: https://github.com/messagebus/messagebus-node-sdk
- Homepage: http://www.messagebus.com/
- Issues: https://github.com/messagebus/messagebus-node-sdk/issues
- npm.io page: https://npm.io/package/messagebus

## Dependencies (4)

- [async](https://npm.io/package/async.md) 0.2.9
- [moment](https://npm.io/package/moment.md) 2.3.0
- [request](https://npm.io/package/request.md) 2.26.0
- [underscore](https://npm.io/package/underscore.md) 1.5.2

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2014-03-03
- 4.1.0 — 2013-04-09
- 0.1.13 — 2013-01-22
- 0.1.12 — 2013-01-21
- 0.1.11 — 2013-01-16
- 0.1.10 — 2012-12-26
- 0.1.9 — 2012-12-26
- 0.1.8 — 2012-12-22
- 0.1.7 — 2012-12-17
- 0.1.6 — 2012-12-17
- 0.1.5 — 2012-12-17
- 0.1.4 — 2012-12-17
- 0.1.3 — 2012-12-17
- 0.1.2 — 2012-12-17
- 0.1.0 — 2012-12-15
- … 2 more at https://npm.io/package/messagebus/versions

## README

![MB icon](https://www.messagebus.com/img/logo.png)

###Message Bus Node.js sdk

Message Bus is a cloud-based platform for easily sending email at scale and with complete insight into your messaging traffic and how recipients are responding to it. All platform functions are available via [REST API](http://docs.messagebusv5.apiary.io/) as well as the language-specific documentation, sample code, libraries, and/or compiled binaries contained in this SDK.

Samples include how to:

* Create sessions
* Send messages
* Use templates
* Use webhooks

If you have questions not answered by the samples or the online documentation, please contact [support](mailto:support@messagebus.com).


####Installing the module

    npm install messagebus

####Sending emails

    var client = new MessageBusAPIClient('apiKey');
    var sessionKey = "DEFAULT";

    var messages = [{
            toEmail: "bob@example.com",
            toName: "Bob",
            subject: "Sample Message with HTML body.",
            plaintextBody: "This is the plain text body.",
            htmlBody: "This is the <b>HTML</b>body.",
            fromEmail: "alice@example.com",
            fromName: "Alice W.",
            returnPath: "bounces@examples.com",
            sessionKey: sessionKey
        }, {
            toEmail: "john@example.com",
            toName: "John",
            subject: "Simple Example with no HTML body.",
            plaintextBody: "This is a plaintext example.",
            fromEmail: "alice@example.com",
            fromName: "Alice W.",
            returnPath: "bounces@examples.com",
            sessionKey: sessionKey
        }
    ];

    client.sendMessages(messages, function(err, resp) {
        if (err) console.error("Error: %j", err);
        else {
            console.info("Email send results");
            for (var i = 0; i < resp.results.length; i++) {
                console.info("To: %s, Message Id: %s, Message Status: %s",
                    resp.results[i].toEmail, resp.results[i].messageId, resp.results[i].messageStatus);
            }
        }
    });

#### License 


    Copyright (c) 2014 Mail Bypass, Inc.

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
    with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License is
    distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and limitations under the License

---
_Source: https://npm.io/package/messagebus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
