Class: SendGrid4r::REST::Mail::TrackingSettings
- Inherits:
-
Struct
- Object
- Struct
- SendGrid4r::REST::Mail::TrackingSettings
- Defined in:
- lib/sendgrid4r/rest/mail/tracking_settings.rb
Instance Attribute Summary collapse
-
#click_tracking ⇒ Object
Returns the value of attribute click_tracking.
-
#ganalytics ⇒ Object
Returns the value of attribute ganalytics.
-
#open_tracking ⇒ Object
Returns the value of attribute open_tracking.
-
#subscription_tracking ⇒ Object
Returns the value of attribute subscription_tracking.
Instance Method Summary collapse
- #disable_click_tracking ⇒ Object
- #disable_ganalytics ⇒ Object
- #disable_open_tracking ⇒ Object
- #disable_subscription_tracking ⇒ Object
- #enable_click_tracking(enable_text) ⇒ Object
- #enable_ganalytics(utm_source, utm_medium, utm_term, utm_content, utm_campaign) ⇒ Object
- #enable_open_tracking(substitution_tag) ⇒ Object
- #enable_subscription_tracking(text, html, substitution_tag) ⇒ Object
- #to_h ⇒ Object
Instance Attribute Details
#click_tracking ⇒ Object
Returns the value of attribute click_tracking
8 9 10 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 8 def click_tracking @click_tracking end |
#ganalytics ⇒ Object
Returns the value of attribute ganalytics
8 9 10 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 8 def ganalytics @ganalytics end |
#open_tracking ⇒ Object
Returns the value of attribute open_tracking
8 9 10 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 8 def open_tracking @open_tracking end |
#subscription_tracking ⇒ Object
Returns the value of attribute subscription_tracking
8 9 10 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 8 def subscription_tracking @subscription_tracking end |
Instance Method Details
#disable_click_tracking ⇒ Object
18 19 20 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 18 def disable_click_tracking tap { |s| s[:click_tracking] = { enable: false } } end |
#disable_ganalytics ⇒ Object
65 66 67 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 65 def disable_ganalytics tap { |s| s[:ganalytics] = { enable: false } } end |
#disable_open_tracking ⇒ Object
31 32 33 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 31 def disable_open_tracking tap { |s| s[:open_tracking] = { enable: false } } end |
#disable_subscription_tracking ⇒ Object
46 47 48 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 46 def disable_subscription_tracking tap { |s| s[:subscription_tracking] = { enable: false } } end |
#enable_click_tracking(enable_text) ⇒ Object
12 13 14 15 16 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 12 def enable_click_tracking(enable_text) tap do |s| s[:click_tracking] = { enable: true, enable_text: enable_text } end end |
#enable_ganalytics(utm_source, utm_medium, utm_term, utm_content, utm_campaign) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 50 def enable_ganalytics( utm_source, utm_medium, utm_term, utm_content, utm_campaign ) tap do |s| s[:ganalytics] = { enable: true, utm_source: utm_source, utm_medium: utm_medium, utm_term: utm_term, utm_content: utm_content, utm_campaign: utm_campaign } end end |
#enable_open_tracking(substitution_tag) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 22 def enable_open_tracking(substitution_tag) tap do |s| s[:open_tracking] = { enable: true, substitution_tag: substitution_tag } end end |
#enable_subscription_tracking(text, html, substitution_tag) ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 35 def enable_subscription_tracking(text, html, substitution_tag) tap do |s| s[:subscription_tracking] = { enable: true, text: text, html: html, substitution_tag: substitution_tag } end end |
#to_h ⇒ Object
69 70 71 |
# File 'lib/sendgrid4r/rest/mail/tracking_settings.rb', line 69 def to_h super.reject { |_key, value| value.nil? } end |