Tôi không được hiểu một điều gì đó tầm thường về email nhưng máy chủ lưu trữ trong defaul_url_options làm gì? Sự cần thiết cho các thiết lập smtp có ý nghĩa với tôi để cấu hình cách email sẽ được gửi đi nhưng làm thế nào là default_url_options có liên quan đến điều đó?ActionMailer default_url_options là gì?
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
host = '<your heroku app>.herokuapp.com'
config.action_mailer.default_url_options = { host: host }
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}