samples/journey_sample.rb in createsend-5.1.1 vs samples/journey_sample.rb in createsend-6.0.0

- old
+ new

@@ -3,15 +3,16 @@ class JourneySample @date = "2019-01-01 00:00" def initialize - raise 'CREATESEND_API_KEY env var missing' if ENV['CREATESEND_API_KEY'].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? raise 'CREATESEND_JOURNEY_ID env var missing' if ENV['CREATESEND_JOURNEY_ID'].nil? raise 'CREATESEND_EMAIL_ID env var missing' if ENV['CREATESEND_EMAIL_ID'].nil? - auth = {:api_key => ENV['CREATESEND_API_KEY']} + auth = {:access_token => ENV['CREATESEND_ACCESS_TOKEN'], :refresh_token => ENV['CREATESEND_REFRESH_TOKEN']} @client = CreateSend::Client.new auth, ENV['CREATESEND_CLIENT_ID'] @journey = CreateSend::Journey.new auth, ENV['CREATESEND_JOURNEY_ID'] end def get_all_journeys