0
heroku 앱에서 보낸 이메일에 링크가 포함됩니다. 나는 ActionMailer railscast를 따라 갔고 모든 것이 잘 동작하도록 만들었다. 그러나 heroku/sendgrid를 사용할 때 링크는 호스트없이 보내진다. 예를 들어, 대신 http://www.reelify.com/users/2 번째 링크는 여기에 단지 http://users/2ActionMailer 링크 호스트 실패 레일 3.1 및 heroku
입니다 이니셜 내 setup_mail.rb입니다 :
require 'development_mail_interceptor'
if Rails.env.production?
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => 'XXX',
:password => 'XXX',
:domain => 'heroku.com'
}
else
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "reelify.com",
:user_name => "XXX",
:password => "XXX",
:authentication => "plain",
:enable_starttls_auto => true
}
end
ActionMailer::Base.default_url_options[:host] = "reelify.com"
ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
나는 또한 내 production.rb이 줄을 추가하려고했습니다
하지만 이제 주석 나는 시험하는 동안 :
config.action_mailer.default_url_options = { :host => 'reelify.com' }
누구든지 아이디어가 있습니까?
아를 사용하고 확인 정확히 내가하고 있었던 일. link_to 도우미가 있고 href로 "@user"를 사용하고있었습니다. 고맙습니다 – kcurtin