Method: ETAPI::Session#email_retrieve_body

Defined in:
lib/etapi/calls/email.rb

#email_retrieve_body(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/etapi/calls/email.rb', line 5

def email_retrieve_body(*args)
  
  # options
  options         = args.extract_options!
  @email_id       = options[:email_id]
  
  # check for required options
  required_options = ["email_id"]
  return false unless check_required(required_options)
  
  # merge parameters and values
  type        = "email"
  method      = "retrieve"
  @parameters = {
    "search_type"   => "emailid",
    "sub_action"    => "htmlemail",
    "search_value"  => @email_id,
    "search_value2" => "",
    "search_value3" => "",
  }
  
  response = build_call(type, method)
  response.xpath("//htmlbody").text rescue false
  
end