Class: Card::Mailer

Inherits:
ActionMailer::Base
  • Object
show all
Defined in:
lib/card/mailer.rb

Constant Summary collapse

@@defaults =
Card.config.email_defaults || {}

Class Method Summary collapse

Class Method Details

.layout(message) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/card/mailer.rb', line 22

def layout message
  <<-HTML
    <!DOCTYPE html>
    <html>
      <head>
        <meta http-equiv="Content-type" content="text/html;charset=UTF-8"/>
      </head>
      <body>
        #{message}
      </body>
    </html>
   HTML
end

.new_mail(*args, &block) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/card/mailer.rb', line 13

def new_mail *args, &block
  mail = Mail.new(args, &block)
  method = Card::Mailer.delivery_method
  mail.delivery_method(method, Card::Mailer.send(:"#{method}_settings"))
  mail.perform_deliveries    = Card::Mailer.perform_deliveries
  mail.raise_delivery_errors = Card::Mailer.raise_delivery_errors
  mail
end