From 00e5c338e831f928afb7beb92de452457a4a7b60 Mon Sep 17 00:00:00 2001 From: Henry Soesanto Date: Fri, 16 Aug 2024 17:02:52 +1000 Subject: [PATCH] index on master: 240b8db Merge pull request #57 from yob/ruby-version --- samples/clients_sample.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/clients_sample.rb b/samples/clients_sample.rb index f784647..ad896df 100644 --- a/samples/clients_sample.rb +++ b/samples/clients_sample.rb @@ -3,11 +3,16 @@ class ClientsSample def initialize - raise 'CREATESEND_ACCESS_TOKEN env var missing' if ENV['CREATESEND_ACCESS_TOKEN'].nil? - raise 'CREATESEND_REFRESH_TOKEN env var missing' if ENV['CREATESEND_REFRESH_TOKEN'].nil? - raise 'CREATESEND_CLIENT_ID env var missing' if ENV['CREATESEND_CLIENT_ID'].nil? + # raise 'CREATESEND_ACCESS_TOKEN env var missing' if ENV['CREATESEND_ACCESS_TOKEN'].nil? + # raise 'CREATESEND_REFRESH_TOKEN env var missing' if ENV['CREATESEND_REFRESH_TOKEN'].nil? + # raise 'CREATESEND_CLIENT_ID env var missing' if ENV['CREATESEND_CLIENT_ID'].nil? + + # auth = auth = {:access_token => ENV['CREATESEND_ACCESS_TOKEN'], :refresh_token => ENV['CREATESEND_REFRESH_TOKEN']} + + raise 'CREATESEND_API_KEY env var missing' if ENV['CREATESEND_API_KEY'].nil? + raise 'CREATESEND_LIST_ID env var missing' if ENV['CREATESEND_LIST_ID'].nil? + @auth = {:api_key => ENV['CREATESEND_API_KEY']} - auth = auth = {:access_token => ENV['CREATESEND_ACCESS_TOKEN'], :refresh_token => ENV['CREATESEND_REFRESH_TOKEN']} @client = CreateSend::Client.new auth, ENV['CREATESEND_CLIENT_ID'] end