Last Updated: September 09, 2019
·
528
· luisguzman02

Action Mailer host

Set host depending on current request. Set a beforefilter on your applicationcontroller

beforefilter :setmailer_host

private
    def set_mailer_host
        ActionMailer::Base.default_url_options[:host] = request.host_with_port
    end