Class: EmailDirect::RelaySend::Email
- Inherits:
-
Object
- Object
- EmailDirect::RelaySend::Email
- Defined in:
- lib/emaildirect/relay_send/email.rb
Overview
Represents a relay send custom email
Instance Attribute Summary collapse
-
#category_id ⇒ Object
readonly
Returns the value of attribute category_id.
Instance Method Summary collapse
-
#initialize(category_id) ⇒ Email
constructor
A new instance of Email.
-
#send(options) ⇒ Object
Sends a custom message.
Constructor Details
#initialize(category_id) ⇒ Email
Returns a new instance of Email.
9 10 11 12 |
# File 'lib/emaildirect/relay_send/email.rb', line 9 def initialize(category_id) @category_id = category_id raise ArgumentError, 'Category ID is required' unless @category_id end |
Instance Attribute Details
#category_id ⇒ Object (readonly)
Returns the value of attribute category_id.
7 8 9 |
# File 'lib/emaildirect/relay_send/email.rb', line 7 def category_id @category_id end |
Instance Method Details
#send(options) ⇒ Object
Sends a custom message. See the docs for all the possible options
16 17 18 19 |
# File 'lib/emaildirect/relay_send/email.rb', line 16 def send() response = EmailDirect.post "/RelaySends/#{category_id}", :body => .to_json Hashie::Mash.new(response) end |