sendpost_ruby

Sendpost - the Ruby gem for the SendPost API

Email API and SMTP relay to not just send and measure email sending, but also alert and optimise. We provide you with tools, expertise and support needed to reliably deliver emails to your customers inboxes on time, every time.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.1
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build sendpost_ruby.gemspec

Then either install the gem locally:

gem install ./sendpost_ruby-1.0.1.gem

(for development, run gem install --dev ./sendpost_ruby-1.0.1.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'sendpost_ruby', '~> 1.0.1'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'sendpost_ruby', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'sendpost_ruby'

api_instance = Sendpost::EmailApi.new
 = 'x_sub_account_api_key_example' # String | Sub-Account API Key
opts = {
  email_message: Sendpost::EmailMessage.new # EmailMessage | Email message
}

begin
  result = api_instance.send_email(, opts)
  p result
rescue Sendpost::ApiError => e
  puts "Exception when calling EmailApi->send_email: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://api.sendpost.io/api/v1

Class Method HTTP request Description
Sendpost::EmailApi send_email POST /subaccount/email/
Sendpost::EmailApi send_email_with_template POST /subaccount/email/template

Documentation for Models

Documentation for Authorization

Endpoints do not require authorization.