Localized host in ActionMailer Views


I’ve got some domains , lets say example.com and example.de and I want
that the link in a ActionMailerView contains the correct localized
host e.g. with <%= @root_url %> .
Currently the host is set in the environment.rb with
“config.action_mailer.default_url_options = { :host =>
example.com” }”.
How can I set the host dynamically and localized? I’m sending my mails
though a Delayed Job.


I think i need to determine the “request.host_with_port” in the
controller and pass it as an argument to the notifier and to the
delayed Job.
Is there a better way to do that?