Sha256: 4a8c246db93ad333a2563ffe3282e7d02370299b36f456f485afc1437dd52094

Contents?: true

Size: 920 Bytes

Versions: 1

Compression:

Stored size: 920 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'createsend'

class SubscribersSample
    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_LIST_ID env var missing' if ENV['CREATESEND_LIST_ID'].nil?
        raise 'CREATESEND_EMAIL_ADDRESS env var missing' if ENV['CREATESEND_EMAIL_ADDRESS'].nil?

        auth = {:access_token => ENV['CREATESEND_ACCESS_TOKEN'], :refresh_token => ENV['CREATESEND_REFRESH_TOKEN']}
        @subscriber = CreateSend::Subscriber.get auth, ENV['CREATESEND_LIST_ID'], ENV['CREATESEND_EMAIL_ADDRESS']
    end

    def get_subscriber
        @subscriber
    end
end

sample = SubscribersSample.new

puts "detailed subscribers: #{sample.get_subscriber.to_json}\n\n"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
createsend-6.0.0 samples/subscribes_sample.rb