module SendcloudClient

Constants

API_BASE

Attributes

api_key[RW]
api_user[RW]

Public Class Methods

sendmail(options = {}) click to toggle source
# File lib/sendcloud_client.rb, line 16
def self.sendmail(options = {})
  return if options[:to].length == 0
  uri = "#{API_BASE}/mail/send"
  res = RestClient.post uri, apiUser: SendcloudClient.api_user,
     apiKey: SendcloudClient.api_key, to: options[:to], from: options[:from], fromName: options[:fromName],
     subject: options[:subject], html: options[:html]

  JSON.parse(res) rescue nil
end
setup() { |self| ... } click to toggle source
# File lib/sendcloud_client.rb, line 8
def self.setup
  yield self
end