Class: QiitaMail::Mailer

Inherits:
Object
  • Object
show all
Defined in:
lib/qiita_mail/mailer.rb

Instance Method Summary collapse

Constructor Details

#initialize(from, to, body) ⇒ Mailer

Returns a new instance of Mailer.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/qiita_mail/mailer.rb', line 13

def initialize(from, to, body)
  @mail = Mail.new do
    from    from
    to      to
    subject 'Qiita Mail'
    # body    mail_body
  end

  @mail.charset = 'utf-8'

  @mail.html_part = Mail::Part.new {
    content_type 'text/html; charset=UTF-8'
    body body
  }

  @mail.delivery_method :sendmail
end

Instance Method Details

#deliverObject



31
32
33
# File 'lib/qiita_mail/mailer.rb', line 31

def deliver
  @mail.deliver
end