Project

General

Profile

« Previous | Next » 

Revision 4672e230

Added by Marc Dequènes over 10 years ago

[evol] allow passing any parameter to the ruby-mail delivery settings

View differences:

lib/cyborghood/mail.rb
require 'cyborghood/objects'
require 'fileutils'
require 'digest/md5'
require 'active_support/core_ext/hash/keys'
# This class handles RFC3156 signed/encrypted messages, validates them, and extract content properly.
......
def deliver
unless self.class.delivery_initialized
config = @config
params = @config.mail.smtp.nil? ? {} : @config.mail.smtp.to_h.symbolize_keys
::Mail.defaults do
delivery_method :smtp, {
:address => config.mail.smtp_server,
:port => config.mail.smtp_port
}
delivery_method :smtp, params
end
self.class.delivery_initialized = true

Also available in: Unified diff