Class: BootstrapEmail::Rails::MailBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/bootstrap-email/rails/mail_builder.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mail) ⇒ MailBuilder

Returns a new instance of MailBuilder.



12
13
14
15
# File 'lib/bootstrap-email/rails/mail_builder.rb', line 12

def initialize(mail)
  @message = mail
  @bootstrap_email = BootstrapEmail::Compiler.new(html_part.decoded, type: :string)
end

Instance Attribute Details

#bootstrap_emailObject (readonly)

Returns the value of attribute bootstrap_email.



6
7
8
# File 'lib/bootstrap-email/rails/mail_builder.rb', line 6

def bootstrap_email
  @bootstrap_email
end

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'lib/bootstrap-email/rails/mail_builder.rb', line 6

def message
  @message
end

Class Method Details

.perform(mail) ⇒ Object



8
9
10
# File 'lib/bootstrap-email/rails/mail_builder.rb', line 8

def self.perform(mail)
  new(mail).perform if mail
end

Instance Method Details

#performObject



17
18
19
20
# File 'lib/bootstrap-email/rails/mail_builder.rb', line 17

def perform
  replace_html_part(generate_html_part_replacement)
  message
end