Sha256: bb1c712f5a76ed77b06e13ce37b27a7d85b4a5855b101f86cc6fdf2796495d8e

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

require 'glue/mail'
require 'glue/mailer/incoming'
require 'glue/mailer/outgoing'  
require 'glue/configuration'

require 'socket'

module Glue

# Handles incoming and outgoing emails. Can be called from
# a Controller or a standalone script (target of the MTA).

class Mailer < Mail
  include IncomingMailer
  include OutgoingMailer
  
  # The outgoing mail server configuration.

  setting :server, :default => {
    :address => 'localhost',
    :port => 25,
    :domain => Socket.gethostname,
    :username => nil,
    :password => nil,
    :authentication => nil
  }, :doc => 'The outgoing server configuration'
  
  # The delivery method. The following options are
  # supported:
  #
  # * :smtp
  # * :sendmail
  # * :test

  setting :delivery_method, :default => :smtp, :doc => 'The delivery method'
    
  # Disable deliveries, useful for testing.

  setting :disable_deliveries, :default => false, :doc => 'Dissable deliveries?'

  # The default template root.
  
  setting :template_root, :default => 'template/mail', :doc => 'The default template root'

  # The default from address
  
  setting :from, :default => 'bot@nitroproject.org', :doc => 'The default from address'
  
  # An array to store the delivered mails, useful
  # for testing.

  cattr_accessor :deliveries; @@deliveries = []  
end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glue-0.41.0 lib/glue/mailer.rb
glue-0.40.0 lib/glue/mailer.rb