Class: SendGrid::MailSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/helpers/mail/mail_settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMailSettings

Returns a new instance of MailSettings.



7
8
9
10
11
12
13
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 7

def initialize
  @bcc = nil
  @bypass_list_management = nil
  @footer = nil
  @sandbox_mode = nil
  @spam_check = nil
end

Instance Attribute Details

#bccObject



27
28
29
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 27

def bcc
  @bcc.nil? ? nil : @bcc.to_json
end

#bypass_list_managementObject



19
20
21
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 19

def bypass_list_management
  @bypass_list_management.nil? ? nil : @bypass_list_management.to_json
end


23
24
25
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 23

def footer
  @footer.nil? ? nil : @footer.to_json
end

#sandbox_modeObject



15
16
17
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 15

def sandbox_mode
  @sandbox_mode.nil? ? nil : @sandbox_mode.to_json
end

#spam_checkObject



31
32
33
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 31

def spam_check
  @spam_check.nil? ? nil : @spam_check.to_json
end

Instance Method Details

#to_jsonObject



35
36
37
38
39
40
41
42
43
# File 'lib/sendgrid/helpers/mail/mail_settings.rb', line 35

def to_json(*)
  {
    'bcc' => bcc,
    'bypass_list_management' => bypass_list_management,
    'footer' => footer,
    'sandbox_mode' => sandbox_mode,
    'spam_check' => spam_check
  }.delete_if { |_, value| value.to_s.strip == '' }
end