Class: CreateSend::Transactional::ClassicEmail

Inherits:
CreateSend
  • Object
show all
Defined in:
lib/createsend/transactional_classic_email.rb

Instance Attribute Summary collapse

Attributes inherited from CreateSend

#auth_details

Instance Method Summary collapse

Methods inherited from CreateSend

#add_auth_details_to_options, #administrators, #auth, authorize_url, #billing_details, #clients, #countries, #delete, exchange_token, #external_session_url, #get, #get_primary_contact, #handle_response, #post, #put, refresh_access_token, #refresh_token, #set_primary_contact, #systemdate, #timezones, user_agent

Constructor Details

#initialize(auth, client_id = nil) ⇒ ClassicEmail

Returns a new instance of ClassicEmail.



6
7
8
9
10
# File 'lib/createsend/transactional_classic_email.rb', line 6

def initialize(auth, client_id = nil)
  @auth = auth
  @client_id = client_id
  super
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/createsend/transactional_classic_email.rb', line 4

def options
  @options
end

Instance Method Details

#groupsObject



17
18
19
20
# File 'lib/createsend/transactional_classic_email.rb', line 17

def groups
  response = get "/transactional/classicemail/groups", :query => client_id
  response.map{|item| Hashie::Mash.new(item)}
end

#send(options) ⇒ Object



12
13
14
15
# File 'lib/createsend/transactional_classic_email.rb', line 12

def send(options)
  response = post "/transactional/classicemail/send", { :body => options.to_json , :query => client_id }
  response.map{|item| Hashie::Mash.new(item)}
end