ruby on rails - Devise mailer custom domain from option -
Given that this is what I have so far Developer Mailer Custom Class: Also Devise.rb I have set out below: < Pre> 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? request object
ActionMailer not work is there a way mailer controller will present URL and set of custom
option to detect
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
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
config.mailer = 'DeviseMailer'
def confirmation_instructions (record, tokens, opt = {}, host) ... end DeviseMailer.confirmation_instructions (..., @host) .deliver
Comments
Post a Comment