打开项目,在 link 生成器中出现问题以通过电子邮件确认
openproject, probleme in link generator for confirmation with email
我在我的服务器上的端口 7000
上使用 openproject,但是当我为用户发送电子邮件邀请时,它会生成激活 url 而没有我的服务器正在侦听 openproject 的端口,
https://myserver/account/activate?token=..
而不是
https://myserver:7000/account/activate?token=..
link 是在 app/mailers/user_mailer.rb
中使用 url_for
函数生成的,
,谢谢
您需要在 application_controller.rb 中添加这样的内容:
default_url_options[:port] = 7000 if Rails.env.production?
更多信息:apidock/default_url_options
action_mailer
的更好方法
使用您在评论中所说的环境配置,如下所示:
config.action_mailer.default_url_options = { host: 'myserver', port: 7000 }
我在我的服务器上的端口 7000
上使用 openproject,但是当我为用户发送电子邮件邀请时,它会生成激活 url 而没有我的服务器正在侦听 openproject 的端口,
https://myserver/account/activate?token=..
而不是
https://myserver:7000/account/activate?token=..
link 是在 app/mailers/user_mailer.rb
中使用 url_for
函数生成的,
,谢谢
您需要在 application_controller.rb 中添加这样的内容:
default_url_options[:port] = 7000 if Rails.env.production?
更多信息:apidock/default_url_options
action_mailer
的更好方法使用您在评论中所说的环境配置,如下所示:
config.action_mailer.default_url_options = { host: 'myserver', port: 7000 }