Module: SFMC::Helpers
- Included in:
- SFMCBase
- Defined in:
- lib/sfmc/helpers.rb
Instance Method Summary collapse
- #get_subscriber_key(email_address) ⇒ Object
- #init(config) ⇒ Object
- #set_base_uri(protocol = 'rest') ⇒ Object
Instance Method Details
#get_subscriber_key(email_address) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/sfmc/helpers.rb', line 16 def get_subscriber_key(email_address) begin SFMC::Contacts::ContactKey.find(email_address).first rescue SFMC::Errors::NotFoundError SecureRandom.uuid end end |
#init(config) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/sfmc/helpers.rb', line 2 def init(config) @subdomain = config[:subdomain] @client_id = config[:client_id] @client_secret = config[:client_secret] @default_send_classification = config[:default_send_classification] @default_subscriber_list = config[:default_subscriber_list] @default_data_extension = config[:default_data_extension] @default_bcc = config[:default_bcc] end |