Class: ExpressMailer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/express_mailer/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/express_mailer/configuration.rb', line 12

def initialize(options = {})
  @default_to = options.fetch(:default_to, nil)
  @default_from = options.fetch(:default_from, '[email protected]')
  @default_footer = options.fetch(:default_footer, nil)
  @subject_prefix = options.fetch(:subject_prefix, nil)
  @app_name = options.fetch(:app_name, 'Example Company')
  @app_logo = options.fetch(:app_logo, nil)
  @app_url = options.fetch(:app_url, 'http://example.com')

  @background_color = options.fetch(:background_color, '#212E3C')
  @text_color = options.fetch(:text_color, '#FFF')
  @border_color = options.fetch(:border_color, '#5E637A')

  @webfont_url = options.fetch(:webfont_url, 'https://fonts.googleapis.com/css?family=Dosis:600|Lato:400,400i,700,700i')
  @headline_font_family = options.fetch(:headline_font_family, "Dosis, 'Helvetica Neue', 'Arial', 'sans-serif'")
  @text_font_family = options.fetch(:text_font_family, "Lato, 'Helvetica Neue', 'Arial', 'sans-serif'")

  @info_text_color = options.fetch(:info_text_color, '#AC8DF7')
  @info_button_text_color = options.fetch(:info_button_text_color, @background_color)
  @info_button_background_color = options.fetch(:info_button_text_color, @info_text_color)

  @success_text_color = options.fetch(:success_text_color, '#02D6A1')
  @success_button_text_color = options.fetch(:success_button_text_color, @background_color)
  @success_button_background_color = options.fetch(:success_button_text_color, @success_text_color)

  @warning_text_color = options.fetch(:warning_text_color, '#FFD166')
  @warning_button_text_color = options.fetch(:warning_button_text_color, @background_color)
  @warning_button_background_color = options.fetch(:warning_button_text_color, @warning_text_color)

  @error_text_color = options.fetch(:error_text_color, '#EF476F')
  @error_button_text_color = options.fetch(:error_button_text_color, @background_color)
  @error_button_background_color = options.fetch(:error_button_text_color, @error_text_color)
end

Instance Attribute Details

#app_logo ⇒ Object

Returns the value of attribute app_logo.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def 
  @app_logo
end

#app_name ⇒ Object

Returns the value of attribute app_name.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def app_name
  @app_name
end

#app_url ⇒ Object

Returns the value of attribute app_url.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def app_url
  @app_url
end

#background_color ⇒ Object

Returns the value of attribute background_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def background_color
  @background_color
end

#border_color ⇒ Object

Returns the value of attribute border_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def border_color
  @border_color
end

Returns the value of attribute default_footer.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def default_footer
  @default_footer
end

#default_from ⇒ Object

Returns the value of attribute default_from.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def default_from
  @default_from
end

#default_to ⇒ Object

Returns the value of attribute default_to.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def default_to
  @default_to
end

#error_button_background_color ⇒ Object

Returns the value of attribute error_button_background_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def error_button_background_color
  @error_button_background_color
end

#error_button_text_color ⇒ Object

Returns the value of attribute error_button_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def error_button_text_color
  @error_button_text_color
end

#error_text_color ⇒ Object

Returns the value of attribute error_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def error_text_color
  @error_text_color
end

#headline_font_family ⇒ Object

Returns the value of attribute headline_font_family.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def headline_font_family
  @headline_font_family
end

#info_button_background_color ⇒ Object

Returns the value of attribute info_button_background_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def info_button_background_color
  @info_button_background_color
end

#info_button_text_color ⇒ Object

Returns the value of attribute info_button_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def info_button_text_color
  @info_button_text_color
end

#info_text_color ⇒ Object

Returns the value of attribute info_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def info_text_color
  @info_text_color
end

#subject_prefix ⇒ Object

Returns the value of attribute subject_prefix.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def subject_prefix
  @subject_prefix
end

#success_button_background_color ⇒ Object

Returns the value of attribute success_button_background_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def success_button_background_color
  @success_button_background_color
end

#success_button_text_color ⇒ Object

Returns the value of attribute success_button_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def success_button_text_color
  @success_button_text_color
end

#success_text_color ⇒ Object

Returns the value of attribute success_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def success_text_color
  @success_text_color
end

#text_color ⇒ Object

Returns the value of attribute text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def text_color
  @text_color
end

#text_font_family ⇒ Object

Returns the value of attribute text_font_family.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def text_font_family
  @text_font_family
end

#warning_button_background_color ⇒ Object

Returns the value of attribute warning_button_background_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def warning_button_background_color
  @warning_button_background_color
end

#warning_button_text_color ⇒ Object

Returns the value of attribute warning_button_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def warning_button_text_color
  @warning_button_text_color
end

#warning_text_color ⇒ Object

Returns the value of attribute warning_text_color.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def warning_text_color
  @warning_text_color
end

#webfont_url ⇒ Object

Returns the value of attribute webfont_url.



3
4
5
# File 'lib/express_mailer/configuration.rb', line 3

def webfont_url
  @webfont_url
end