summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/registration.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/registration.rb b/lib/registration.rb
index b82cdb4..6fc4b9a 100644
--- a/lib/registration.rb
+++ b/lib/registration.rb
@@ -12,7 +12,14 @@ def send_registration_emails_for(band, pdf_url)
mail.body = erb :registration_email, :layout => false, :locals => { :pdf_url => pdf_url }
if settings.environment != :test && settings.respond_to?(:smtp)
- mail.delivery_method :smtp, settings.smtp
+ # Since the sinatra/indifferent_hash implementation that holds
+ # the settings converts all keys to strings, and the mail gem
+ # expects the keys as symbols, we need to create a new hash
+ # with the correct keys.
+ smtp_settings = Hash[settings.smtp.map { |e| [e[0].to_sym, e[1]] }]
+
+ logger.debug "smtp settings: #{smtp_settings.inspect}"
+ mail.delivery_method :smtp, smtp_settings
end
mail.deliver!
rescue Net::SMTPError => e