Class: Courrier::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/courrier/configuration.rb,
lib/courrier/configuration/inbox.rb,
lib/courrier/configuration/providers.rb

Defined Under Namespace

Classes: Inbox, ProviderConfig, Providers

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/courrier/configuration.rb', line 27

def initialize
  @email = {provider: "logger"}
  @subscriber = {}

  @logger = ::Logger.new($stdout)
  @email_path = default_email_path

  @layouts = nil
  @default_url_options = {host: ""}
  @auto_generate_text = false

  @from = nil
  @reply_to = nil
  @cc = nil
  @bcc = nil

  @providers = Courrier::Configuration::Providers.new
  @inbox = Courrier::Configuration::Inbox.new
end

Instance Attribute Details

#auto_generate_textObject

Returns the value of attribute auto_generate_text.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def auto_generate_text
  @auto_generate_text
end

#bccObject

Returns the value of attribute bcc.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def bcc
  @bcc
end

#ccObject

Returns the value of attribute cc.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def cc
  @cc
end

#default_url_optionsObject

Returns the value of attribute default_url_options.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def default_url_options
  @default_url_options
end

#emailObject

Returns the value of attribute email.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def email
  @email
end

#email_pathObject

Returns the value of attribute email_path.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def email_path
  @email_path
end

#fromObject

Returns the value of attribute from.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def from
  @from
end

#inboxObject (readonly)

Returns the value of attribute inbox.



25
26
27
# File 'lib/courrier/configuration.rb', line 25

def inbox
  @inbox
end

#layoutsObject

Returns the value of attribute layouts.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def layouts
  @layouts
end

#loggerObject

Returns the value of attribute logger.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def logger
  @logger
end

#providersObject (readonly)

Returns the value of attribute providers.



25
26
27
# File 'lib/courrier/configuration.rb', line 25

def providers
  @providers
end

#reply_toObject

Returns the value of attribute reply_to.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def reply_to
  @reply_to
end

#subscriberObject

Returns the value of attribute subscriber.



22
23
24
# File 'lib/courrier/configuration.rb', line 22

def subscriber
  @subscriber
end

Instance Method Details

#api_keyObject



59
60
61
62
63
# File 'lib/courrier/configuration.rb', line 59

def api_key
  warn "[DEPRECATION] `api_key` is deprecated. Use `email = { api_key: '…' }` instead. Will be removed in 1.0.0"

  @email[:api_key]
end

#api_key=(value) ⇒ Object



65
66
67
68
69
# File 'lib/courrier/configuration.rb', line 65

def api_key=(value)
  warn "[DEPRECATION] `api_key=` is deprecated. Use `email = { api_key: '…' }` instead. Will be removed in 1.0.0"

  @email[:api_key] = value
end

#providerObject



47
48
49
50
51
# File 'lib/courrier/configuration.rb', line 47

def provider
  warn "[DEPRECATION] `provider` is deprecated. Use `email = { provider: '…' }` instead. Will be removed in 1.0.0"

  @email[:provider]
end

#provider=(value) ⇒ Object



53
54
55
56
57
# File 'lib/courrier/configuration.rb', line 53

def provider=(value)
  warn "[DEPRECATION] `provider=` is deprecated. Use `email = { provider: '…' }` instead. Will be removed in 1.0.0"

  @email[:provider] = value
end