class Card::Mailer

Public Class Methods

defaults_from_config() click to toggle source
# File lib/card/mailer.rb, line 30
def defaults_from_config
  (Card.config.email_defaults || {}).symbolize_keys.tap do |defaults|
    defaults[:return_path] ||= defaults[:from] if defaults[:from]
    defaults[:charset] ||= "utf-8"
  end
end
layout(message) click to toggle source
# File lib/card/mailer.rb, line 16
      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) click to toggle source
# File lib/card/mailer.rb, line 7
def new_mail *args, &block
  Mail.new(args, &block).tap do |mail|
    method = Card::Mailer.delivery_method
    mail.delivery_method(method, send(:"#{method}_settings"))
    mail.perform_deliveries    = perform_deliveries
    mail.raise_delivery_errors = raise_delivery_errors
  end
end