ruby on rails - Devise mailer custom domain from option -


Given that request object ActionMailer not work is there a way mailer controller will present URL and set of custom option to detect

this is what I have so far application_controller.rb ?:

  before_filter: images ,: hide_sidebar ,: global_vars ,: set_mailer_host before_action: sidebar_menu def set_mailer_host ActionMailer :: Base.default_url_options [: host] = request.host_with_port @ Host = request.env ['HTTP_HOST'] until request.env ['HTTP_HOST'] is not included Is. 'Local Host' Termination   

Developer Mailer Custom Class:

  Class DeviseMailer & lt; Devise :: Mailer Assistant: Allows application # to access all helpers as defined in `application_helper`. Include Devise :: Controllers :: UrlHelpers # Optional such as. `Confirmation_url` def confirmation_instructions (record, token, opts = {}) if record.events.present? Name = record.events.last.name @event = name any name = "# {record.first_name}," finally, in which [from] = "noreply @ # {@ host}" @host options chooses, then [subject] = "# {name} registration - Confirmation required" super end end   

Also Devise.rb I have set out below: < Pre> config.mailer = 'DeviseMailer'

I do not know why I'm still getting the default domain instead of the current URL.

Since I have many URLs pointing to the same application, is there a way to find out and can be configured for developer mailers?

Why will not you pass the host as a logic for your mailer?

  def confirmation_instructions (record, tokens, opt = {}, host) ... end DeviseMailer.confirmation_instructions (..., @host) .deliver    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -