I have a solution to this problem, but I don't think this is the best way to do this. I tried and still try to find a better solution, but here is what I did in my email template. The reason I put this in my email template is because I use Devise, but I hope to come up with something better.
subdomain = @resource.account.subdomain subdomain = (subdomain || "") subdomain += "." unless subdomain.empty? host = [subdomain, ActionMailer::Base::default_url_options[:host]].join
You can pass the host to url_for now like
user_confirmation_url(:host => host)
bokor source share