module SendGrid4r::REST::Settings::Tracking
Constants
- Click
- GoogleAnalytics
- Open
- Subscription
Public Class Methods
create_click(resp)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 12 def self.create_click(resp) return resp if resp.nil? Click.new(resp['enabled']) end
create_google_analytics(resp)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 22 def self.create_google_analytics(resp) return resp if resp.nil? GoogleAnalytics.new( resp['enabled'], resp['utm_source'], resp['utm_medium'], resp['utm_term'], resp['utm_content'], resp['utm_campaign'] ) end
create_open(resp)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 32 def self.create_open(resp) return resp if resp.nil? Open.new(resp['enabled']) end
create_subscription(resp)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 41 def self.create_subscription(resp) return resp if resp.nil? Subscription.new( resp['enabled'], resp['landing'], resp['url'], resp['replace'], resp['html_content'], resp['plain_content'] ) end
url(name = nil)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 49 def self.url(name = nil) url = "#{BASE_URL}/tracking_settings" url = "#{url}/#{name}" unless name.nil? url end
Public Instance Methods
get_settings_click(&block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 63 def get_settings_click(&block) resp = get(@auth, Settings::Tracking.url(:click), &block) finish(resp, @raw_resp) { |r| Settings::Tracking.create_click(r) } end
get_settings_google_analytics(&block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 74 def get_settings_google_analytics(&block) endpoint = Settings::Tracking.url(:google_analytics) resp = get(@auth, endpoint, &block) finish(resp, @raw_resp) do |r| Settings::Tracking.create_google_analytics(r) end end
get_settings_open(&block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 90 def get_settings_open(&block) resp = get(@auth, Settings::Tracking.url(:open), &block) finish(resp, @raw_resp) { |r| Settings::Tracking.create_open(r) } end
get_settings_subscription(&block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 100 def get_settings_subscription(&block) endpoint = Settings::Tracking.url(:subscription) resp = get(@auth, endpoint, &block) finish(resp, @raw_resp) do |r| Settings::Tracking.create_subscription(r) end end
get_tracking_settings(limit: nil, offset: nil, &block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 55 def get_tracking_settings(limit: nil, offset: nil, &block) params = {} params[:limit] = limit unless limit.nil? params[:offset] = offset unless offset.nil? resp = get(@auth, Settings::Tracking.url, params, &block) finish(resp, @raw_resp) { |r| Settings.create_results(r) } end
patch_settings_click(params:, &block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 68 def patch_settings_click(params:, &block) endpoint = Settings::Tracking.url(:click) resp = patch(@auth, endpoint, params.to_h, &block) finish(resp, @raw_resp) { |r| Settings::Tracking.create_click(r) } end
patch_settings_google_analytics(params:, &block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 82 def patch_settings_google_analytics(params:, &block) endpoint = Settings::Tracking.url(:google_analytics) resp = patch(@auth, endpoint, params.to_h, &block) finish(resp, @raw_resp) do |r| Settings::Tracking.create_google_analytics(r) end end
patch_settings_open(params:, &block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 95 def patch_settings_open(params:, &block) resp = patch(@auth, Settings::Tracking.url(:open), params.to_h, &block) finish(resp, @raw_resp) { |r| Settings::Tracking.create_open(r) } end
patch_settings_subscription(params:, &block)
click to toggle source
# File lib/sendgrid4r/rest/settings/tracking.rb, line 108 def patch_settings_subscription(params:, &block) endpoint = Settings::Tracking.url(:subscription) resp = patch(@auth, endpoint, params.to_h, &block) finish(resp, @raw_resp) do |r| Settings::Tracking.create_subscription(r) end end