Class: Brightbytes::Sendgrid::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/brightbytes/sendgrid/config.rb

Defined Under Namespace

Classes: UnsubscribeConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dummy_recipientObject

Returns the value of attribute dummy_recipient.



8
9
10
# File 'lib/brightbytes/sendgrid/config.rb', line 8

def dummy_recipient
  @dummy_recipient
end

#subst_patternObject

Returns the value of attribute subst_pattern.



8
9
10
# File 'lib/brightbytes/sendgrid/config.rb', line 8

def subst_pattern
  @subst_pattern
end

Instance Method Details

#sendgridObject



14
15
16
# File 'lib/brightbytes/sendgrid/config.rb', line 14

def sendgrid
  @sendgrid ||= Brightbytes::Sendgrid::SmtpApiHeader.new
end

#unsubscribeObject



22
23
24
25
26
27
28
29
# File 'lib/brightbytes/sendgrid/config.rb', line 22

def unsubscribe
  @unsubscribe ||= UnsubscribeConfig.new(
    [],
    nil, 
    'If you would like to unsubscribe and stop receiving these emails <a href="%s" rel="nofollow">click here</a>.',
    'If you would like to unsubscribe and stop receiving these emails click here: %s'
  )
end

#unsubscribe_categories(*categories) ⇒ Object



31
32
33
# File 'lib/brightbytes/sendgrid/config.rb', line 31

def unsubscribe_categories(*categories)
  unsubscribe.categories = categories.flatten.map(&:to_sym)
end