Module: Mailblastr

Defined in:
lib/mailblastr.rb,
lib/mailblastr/logs.rb,
lib/mailblastr/error.rb,
lib/mailblastr/polls.rb,
lib/mailblastr/client.rb,
lib/mailblastr/emails.rb,
lib/mailblastr/events.rb,
lib/mailblastr/topics.rb,
lib/mailblastr/domains.rb,
lib/mailblastr/version.rb,
lib/mailblastr/api_keys.rb,
lib/mailblastr/contacts.rb,
lib/mailblastr/segments.rb,
lib/mailblastr/webhooks.rb,
lib/mailblastr/audiences.rb,
lib/mailblastr/campaigns.rb,
lib/mailblastr/templates.rb,
lib/mailblastr/automations.rb,
lib/mailblastr/contact_properties.rb

Overview

The MailBlastr API client.

Mailblastr.api_key = "mb_xxxxxxxxx"

sent = Mailblastr::Emails.send({
from: "Acme <hello@yourdomain.com>",
to: ["user@example.com"],
subject: "Hello from MailBlastr",
html: "<p>Your first email</p>"
})
sent["id"] # => "..."

Defined Under Namespace

Modules: ApiKeys, Audiences, Automations, Batch, Campaigns, Client, ContactProperties, Contacts, Domains, Emails, Events, Logs, Polls, Segments, Templates, Topics, Webhooks Classes: Error

Constant Summary collapse

DEFAULT_BASE_URL =
"https://www.mailblastr.com/api"
DEFAULT_TIMEOUT =

Per-request network timeout, in seconds, applied to both the connect (open) and read phases. 0 or nil means "no timeout".

30
DEFAULT_MAX_RETRIES =

How many times a retryable response (HTTP 429/503) is retried before giving up. 0 disables retries (a single attempt).

2
VERSION =
"1.3.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Your API key, e.g. "mb_xxxxxxxxx". Required before any call.



46
47
48
# File 'lib/mailblastr.rb', line 46

def api_key
  @api_key
end

.base_urlObject



57
58
59
# File 'lib/mailblastr.rb', line 57

def base_url
  @base_url || DEFAULT_BASE_URL
end

.max_retriesObject



65
66
67
# File 'lib/mailblastr.rb', line 65

def max_retries
  @max_retries.nil? ? DEFAULT_MAX_RETRIES : @max_retries
end

.timeoutObject



61
62
63
# File 'lib/mailblastr.rb', line 61

def timeout
  @timeout.nil? ? DEFAULT_TIMEOUT : @timeout
end

Class Method Details

.configure {|_self| ... } ⇒ Object

Mailblastr.configure do |config| config.api_key = ENV end

Yields:

  • (_self)

Yield Parameters:

  • _self (Mailblastr)

    the object that the method was called on



72
73
74
# File 'lib/mailblastr.rb', line 72

def configure
  yield self
end