Given an application mounted at:

Following config is added in application.rb to make sure all links are prepended with /app1:

config.action_controller.relative_url_root = '/app1'

However, if you are generating an URL in mailer view using url helper, this config is not automatically used. You need to specify the path using script_name in the "default_url_options" config. E.g.

config.action_mailer.default_url_options = { host: '', port: 443, protocol: 'https', script_name: '/app1' }

With this your URL generated in the email would be correct.