Module: UniOne::Client::Email

Included in:
UniOne::Client
Defined in:
lib/unione/client/email.rb

Instance Method Summary collapse

Instance Method Details

#send_email(message) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/unione/client/email.rb', line 4

def send_email(message)
  post 'email/send.json', message
  validate_response({
    'type' => 'object', 'required' => ['status', 'job_id', 'emails'], 'properties' => {
      'status' => {'type' => 'string'},
      'job_id' => {'type' => 'string'},
      'emails' => {'items' => {'type' => 'string'}},
      'failed_emails' => {'type' => 'object'}}
  })
end

#subscribe_email(params) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/unione/client/email.rb', line 15

def subscribe_email(params)
  post 'email/subscribe.json', params
  validate_response({
    'type' => 'object', 'required' => ['status'], 'properties' => {
      'status' => {'type' => 'string'}}
  })
end