アクションメーラーをセットアップしました。メールは送信されておらず、エラーもありません。
これをデバッグするためにどこから検索を開始できますか?
class Notifier < ActionMailer::Base
default_url_options[:host] = APP_DOMAIN
def email_blast(user, subject, message)
subject subject
from NOTIFIER_EMAIL
recipients user.email
sent_on Time.zone.now
body :user => user.first_name + ' ' + user.last_name, :message => message
end
メールが送信されたことがログに返されますが、実際のメールは送信されません。
また、これが機能しない理由は、クラスターからソロボックスに切り替えて、一部のサーバー設定が上書きされたためです。おそらくこれが機能していない理由だと思います。私が見なければならない特定のサーバー設定を知っている人はいますか?
アップデート:
ActionMailer::Base.delivery_method = :sendmail
config.action_mailer.default_url_options = { :host => "75.101.153.93" }
これは私の production.rb で見つけました。このコードは、機能していた当初はここにありました。繰り返しますが、サーバーに何かが欠けているに違いないと思います..「which sendmail」を実行したところ、 /usr/bin/sendmail が返されたので、これを追加しました:
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
config.action_mailer.sendmail_settings = {
:location => '/usr/bin/sendmail',
:arguments => '-i -t'
}
サーバーを再デプロイし、再起動して、テストしました。メールは送信されませんでした。
production.log には、何かが送信されたことが示されています。
Processing MediaController#create_a_video (for 173.161.167.41 at 2010-06-03 11:58:13) [GET]
Parameters: {"action"=>"create_a_video", "controller"=>"media", "organization_id"=>"470", "_"=>"1275591493194"}
Sent mail to info@hqchannel.com
Rendering media/create_a_video
Completed in 128ms (View: 51, DB: 1) | 200 OK [http://invent.hqchannel.com/organizations/470/media/create_a_video?_=1275591493194]