Class: CreateSend::Transactional::SmartEmail
- Inherits:
-
CreateSend
- Object
- CreateSend
- CreateSend::Transactional::SmartEmail
- Defined in:
- lib/createsend/transactional_smart_email.rb
Instance Attribute Summary collapse
-
#smart_email_id ⇒ Object
readonly
Returns the value of attribute smart_email_id.
Attributes inherited from CreateSend
Class Method Summary collapse
Instance Method Summary collapse
- #details ⇒ Object
-
#initialize(auth, smart_email_id) ⇒ SmartEmail
constructor
A new instance of SmartEmail.
- #send(options) ⇒ Object
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, smart_email_id) ⇒ SmartEmail
Returns a new instance of SmartEmail.
12 13 14 15 16 |
# File 'lib/createsend/transactional_smart_email.rb', line 12 def initialize(auth, smart_email_id) @auth = auth @smart_email_id = smart_email_id super end |
Instance Attribute Details
#smart_email_id ⇒ Object (readonly)
Returns the value of attribute smart_email_id.
4 5 6 |
# File 'lib/createsend/transactional_smart_email.rb', line 4 def smart_email_id @smart_email_id end |
Class Method Details
.list(auth, options = nil) ⇒ Object
6 7 8 9 10 |
# File 'lib/createsend/transactional_smart_email.rb', line 6 def self.list(auth, = nil) cs = CreateSend.new auth response = cs.get "/transactional/smartemail", :query => response.map{|item| Hashie::Mash.new(item)} end |
Instance Method Details
#details ⇒ Object
18 19 20 21 |
# File 'lib/createsend/transactional_smart_email.rb', line 18 def details response = get "/transactional/smartemail/#{@smart_email_id}" Hashie::Mash.new(response) end |
#send(options) ⇒ Object
23 24 25 26 |
# File 'lib/createsend/transactional_smart_email.rb', line 23 def send() response = post "/transactional/smartemail/#{@smart_email_id}/send", { :body => .to_json } response.map{|item| Hashie::Mash.new(item)} end |