Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

for rails 2.3.9 / 1.9.3-p327 symbolise keys is required for mail to work... #219

Closed
wants to merge 1 commit into from

2 participants

reubenjs Steve Kenworthy
reubenjs

.... otherwise keys are loaded as strings and fail with a connection error. Also needed to change to ActionMailer::Base for the settings to stick.

reubenjs reubenjs for rails 2.3.9 / 1.9.3-p327 symbolise keys is required for mail to w…
…ork. otherwise keys are loaded as strings and fail with a connection error. Also needed to change to ActionMailer::Base for the settings to stick.
b68c543
Steve Kenworthy
Owner

Will need to double check if this will work when ffcrm is loaded as an engine as it may affect the entire rails stack, not just inside the engine.

Rails.application.routes.default_url_options seems to be the new way to do this

Steve Kenworthy steveyken closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 1, 2012
  1. reubenjs

    for rails 2.3.9 / 1.9.3-p327 symbolise keys is required for mail to w…

    reubenjs authored
    …ork. otherwise keys are loaded as strings and fail with a connection error. Also needed to change to ActionMailer::Base for the settings to stick.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 config/initializers/action_mailer.rb
6 config/initializers/action_mailer.rb
View
@@ -4,12 +4,12 @@
# Set SMTP settings if present.
smtp_settings = Setting.smtp || {}
if smtp_settings["address"].present?
- Rails.application.config.action_mailer.delivery_method = :smtp
- Rails.application.config.action_mailer.smtp_settings = smtp_settings
+ ActionMailer::Base.delivery_method = :smtp
+ ActionMailer::Base.smtp_settings = smtp_settings.symbolize_keys
end
end
# Set default host for outgoing emails
if Setting.host.present?
- (Rails.application.config.action_mailer.default_url_options ||= {})[:host] = Setting.host
+ (ActionMailer::Base.default_url_options ||= {})[:host] = Setting.host
end
Something went wrong with that request. Please try again.