[Radiant] Newsletter extension config
Andrew Neil
andrew.jr.neil at googlemail.com
Sun Jun 1 16:29:00 CDT 2008
I've just been trying out the newsletter extension (0.1.5 cloned from
github) with radiant 0.6.7, and I've been running into some
difficulties with its configuration.
I have been able to make it work, with limited functionality, by
setting the following in my config/environment.rb (within the
Radiant::Initializer.run do |config| block):
config.action_mailer.delivery_method = :test
# config.frameworks -= [ :action_mailer ]
The second line is deliberately commented out. It could be removed
entirely, but I left it in to remind myself of that step. In the
default environment.rb file, this line was not commented out, and it
prevents the newsletter extension from running.
With these settings, I am able to launch radiant, and can test all the
actions of the newsletter extension. Rather than emails being sent,
their contents are output to the console. I have been able to explore
the functionality of the extension this way, and it looks very
promising.
I gather that the default delivery method for action mailer is smtp.
Replacing the two lines of config given above with the following:
config.action_mailer.delivery_method = :smtp
Allows me to launch radiant, but if I try to send an email using the
newsletter extension (e.g. with the "Send test email" action) I get an
error:
Errno::ECONNREFUSED (Connection refused - connect(2)):
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/protocol.rb:206:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/protocol.rb:206:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/protocol.rb:206:in `old_open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/timeout.rb:56:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/timeout.rb:76:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/protocol.rb:206:in `old_open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/smtp.rb:393:in `do_start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/smtp.rb:378:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/
lib/ruby/1.8/net/smtp.rb:316:in `start'
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
actionmailer/lib/action_mailer/base.rb:586:in `perform_delivery_smtp'
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
actionmailer/lib/action_mailer/base.rb:469:in `__send__'
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
actionmailer/lib/action_mailer/base.rb:469:in `deliver!'
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
actionmailer/lib/action_mailer/base.rb:383:in `deliver'
/vendor/extensions/newsletter/app/controllers/
newsletters_controller.rb:59:in `send_test_email'
/vendor/extensions/newsletter/app/controllers/
newsletters_controller.rb:13:in `create'
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
actionpack/lib/action_controller/base.rb:1158:in `send'
...
(Incidentally, I got this same error when the line config.framework -=
[ :action_mailer ] was not commented out, and delivery_method was set
to :test)
Finally, if I include the config options as directed in the README:
config.action_mailer.server_settings = {
:address => "smtp.gmail.com"
:port => 587,
:domain => "westportbookfestival.org",
:authentication => :plain,
:user_name => "user",
:password => "pass"
}
I am not even able to start the server. It crashes out with the
following:
Exiting
/Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
actionmailer/lib/action_mailer/base.rb:354:in `method_missing':
undefined method `server_settings=' for ActionMailer::Base:Class
(NoMethodError)
from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
railties/lib/initializer.rb:328:in `send'
from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
railties/lib/initializer.rb:328:in `initialize_framework_settings'
from /Library/Ruby/Gems/1.8/gems/radiant-0.6.7/vendor/rails/
railties/lib/initializer.rb:327:in `each'
...
I have tried using smtp settings for other email accounts with the
same result. Even if I pass an empty hash to the server_settings
(config.action_mailer.server_settings = { }) I get the same result.
Can anyone suggest what I might be doing wrong, or how I might fix this?
Many thanks,
Drew
More information about the Radiant
mailing list