Ruby on Rails
Saturday, February 14, 2015
I am trying to figure out why this block of code in my environments/production.rb file is causing the dkim signing to break. I have email being sent from a rake task with my UserMailer class. It is derived from Devise::Mailer. If I have the action_mailer configuration block within the "config.after_initialize" the dkim signature does not go through. If I don't have that line "after_initialize" the signature goes through. Can someone shed some light on this for me?
-- Here's the code for my UserMailer class and the production.rb file.
user_mailer.rb
require "#{Rails.root}/app/helpers/user_helper"
include UserHelper
class UserMailer < Devise::Mailer
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
default from: "Save The Sparkles <contact@savethesparkles.com>",
reply_to: "contact@savethesparkles.com"
...
end
environments/production.rb
config.action_mailer.asset_host = 'http://savethesparkles.com'
config.action_mailer.default_url_options = { host: 'savethesparkles.com' }
config.after_initialize do
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: 'email-smtp.us-east-1.amazonaws.com',
port: 587,
domain: 'savethesparkles.com',
user_name: ENV['AWS_SES_USER'],
password: ENV['AWS_SES_PASS'],
authentication: :login,
enable_starttls_auto: true
}
end
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3965c764-63be-4deb-920b-51a945f2557c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment