Module: RepsClient::LeadMethods
Instance Method Summary collapse
-
#save_lead(community_id, contact, prospect = nil) ⇒ true, false
Submit a new lead to the remote REPS service.
Instance Method Details
#save_lead(community_id, contact, prospect = nil) ⇒ true, false
Submit a new lead to the remote REPS service. Each lead must have a contact and community_id.
277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/reps_client/lead.rb', line 277 def save_lead(community_id,contact,prospect=nil) LeadMethods.validate_required!(:community_id => community_id, :contact => contact) LeadMethods.validate_type!(:community_id, community_id, Integer) contact.validate! soap_params = {:community_id => community_id, :new_contact => contact.to_soap_hash, :order! => [:enterprise_key, :community_id, :new_contact] } if prospect prospect.validate! soap_params[:new_prospect] = prospect.to_soap_hash soap_params[:order!] << :new_prospect end response = send_soap_request(:save_lead, soap_params).to_hash response[:save_lead_response][:save_lead_result][:diffgram][:document_element].nil? end |