Class: SendGrid4r::REST::Mail::MailSettings

Inherits:
Struct
  • Object
show all
Defined in:
lib/sendgrid4r/rest/mail/mail_settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bccObject

Returns the value of attribute bcc

Returns:

  • (Object)

    the current value of bcc



8
9
10
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 8

def bcc
  @bcc
end

#bypass_list_managementObject

Returns the value of attribute bypass_list_management

Returns:

  • (Object)

    the current value of bypass_list_management



8
9
10
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 8

def bypass_list_management
  @bypass_list_management
end

Returns the value of attribute footer

Returns:

  • (Object)

    the current value of footer



8
9
10
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 8

def footer
  @footer
end

#sandbox_modeObject

Returns the value of attribute sandbox_mode

Returns:

  • (Object)

    the current value of sandbox_mode



8
9
10
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 8

def sandbox_mode
  @sandbox_mode
end

#spam_checkObject

Returns the value of attribute spam_check

Returns:

  • (Object)

    the current value of spam_check



8
9
10
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 8

def spam_check
  @spam_check
end

Instance Method Details

#disable_bccObject



15
16
17
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 15

def disable_bcc
  tap { |s| s[:bcc] = { enable: false } }
end

#disable_bypass_list_managementObject



23
24
25
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 23

def disable_bypass_list_management
  tap { |s| s[:bypass_list_management] = { enable: false } }
end


31
32
33
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 31

def disable_footer
  tap { |s| s[:footer] = { enable: false } }
end

#disable_sandbox_modeObject



39
40
41
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 39

def disable_sandbox_mode
  tap { |s| s[:sandbox_mode] = { enable: false } }
end

#disable_spam_checkObject



53
54
55
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 53

def disable_spam_check
  tap { |s| s[:spam_check] = { enable: false } }
end

#enable_bcc(email) ⇒ Object



11
12
13
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 11

def enable_bcc(email)
  tap { |s| s[:bcc] = { enable: true, email: email } }
end

#enable_bypass_list_managementObject



19
20
21
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 19

def enable_bypass_list_management
  tap { |s| s[:bypass_list_management] = { enable: true } }
end


27
28
29
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 27

def enable_footer(text, html)
  tap { |s| s[:footer] = { enable: true, text: text, html: html } }
end

#enable_sandbox_modeObject



35
36
37
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 35

def enable_sandbox_mode
  tap { |s| s[:sandbox_mode] = { enable: true } }
end

#enable_spam_check(threshold, post_to_url) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 43

def enable_spam_check(threshold, post_to_url)
  tap do |s|
    s[:spam_check] = {
      enable: true,
      threshold: threshold,
      post_to_url: post_to_url
    }
  end
end

#to_hObject



57
58
59
# File 'lib/sendgrid4r/rest/mail/mail_settings.rb', line 57

def to_h
  super.reject { |_key, value| value.nil? }
end