Giter Site home page Giter Site logo

messagebus_ruby_api's Introduction

Messagebus Ruby API

Installation

gem install messagebus_ruby_api

Basic Use

Start by requiring MessabusApi:

require 'messagebus_ruby_api'

Then create an instance of the Messagebus class with your account information

client = MessagebusApi::Messagebus.new("<INSERT_YOUR_API_KEY>")

Sending a single message

Create Required Parameters

params = { :toEmail => '[email protected]',
  :toName => 'EmailUser',
  :fromEmail => '[email protected]',
  :fromName => 'API',
  :subject => 'Unit Test Message',
  :customHeaders => ["sender"=>"[email protected]"],
  :plaintextBody => 'This message is only a test sent by the Ruby MessageBus client library.',
  :htmlBody => "<html><body>This message is only a test sent by the Ruby MessageBus client library.</body></html>",
  :tags => ['RUBY']
}

Send the message

client.add_message(params)

Examples

The provided examples illustrate how to:
- send a single email message in the simplest way
- send one or more emails (where the email body is passed with the api call)
- send one or more templated emails (where a key referencing a previously stored email body is passed with the api call)
- create a mailing list, add and delete mailing list entries and list the existing mailing lists
- list recent email unsubscribes
- list recent email statistics
- list recent delivery errors

SSL Certificates

If you encounter SSL certificate problems, use the cacert_info() method to specify a
cacert.pem file (remember to specify the full path).

The curl site has an up to date version of the file:

http://curl.haxx.se/ca/cacert.pem

Older Versions

If you are using the old api with the text OK:<UUID> responses, please be sure to get the ‘v1’ branch If you are using the old api with the ‘body’ parameter (instead of the new ‘plaintextBody’ and ‘htmlBody’ parameters), please be sure to get the ‘v0’ branch

Tests

To run the tests, issue the following command from the root of the project:
bundle exec rspec spec/messagebus_ruby_api/client_spec.rb

More info

Contact MessageBus if you have questions or problems (https://www.messagebus.com/contact)

messagebus_ruby_api's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.