【问题标题】:sending multiple params via email通过电子邮件发送多个参数
【发布时间】:2013-02-04 20:20:47
【问题描述】:

大家好,我正在尝试通过电子邮件更改用户密码的方法,我当前的代码是:

<html>
<body>
    <p>Hello ${userInstance.user.username}, your password will be set to ${userInstance.new_pass} to finalise your password request, please click the link below.</p>
    <h2><g:link controller="reset" action="reset" params="[id:userInstance.user.id]" absolute="true">Please change my password</g:link></h2>
</body>

当前链接仅将用户 ID 参数发送到我在 grails 中的方法。我也希望将密码作为参数发送!通过此链接发送 userInstance.new_pass 的可能解决方案是什么?

附言我正在使用 grails 邮件插件。

【问题讨论】:

  • 在电子邮件中发送密码在安全方面是非常非常糟糕的做法。详情请见:Is sending password to user email secure?
  • 是的,这是真的.. 最好在邮件中发送更新链接
  • 我知道这是一种不好的做法,我只是将其作为临时快速修复,直到完成正确的方法。

标签: html email grails


【解决方案1】:

你试过吗?

 <g:link controller="reset" action="reset" params="[id:userInstance.user.id;password:userInstance.user.password]" absolute="true">Please change my password</g:link>

【讨论】:

  • 似乎不起作用.._grails_app_views_reset__resetMail_gsp:22:期待']',发现':'@第22行,第271列。:userInstance.user.id;密码:userInsta ^ 1错误
  • 使用 , 而不是 ; - 这是 Groovy 列表语法。
猜你喜欢
  • 1970-01-01
  • 2021-02-05
  • 2020-01-10
  • 1970-01-01
  • 2013-10-30
  • 1970-01-01
  • 1970-01-01
  • 2012-01-07
相关资源
最近更新 更多