Class: SFMC::Contacts::ContactKey
- Defined in:
- lib/sfmc/contacts/contact_key.rb
Constant Summary
Constants inherited from SFMCBase
Class Method Summary collapse
Methods inherited from SFMCBase
authenticate_and_retry, request
Methods included from Helpers
#get_subscriber_key, #init, #set_base_uri
Methods included from Errors
Class Method Details
.find(emails, max = 1) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sfmc/contacts/contact_key.rb', line 6 def self.find(emails, max = 1) emails = [emails] unless emails.is_a? Array params = { channelAddressList: emails, maximumCount: max, } response = create(nil, params) response.channelAddressResponseEntities.map do |channel| key = channel[:contactKeyDetails].first[:contactKey] raise SFMC::Errors::NotFoundError if key.nil? key end end |