ruby-on-rails - 在 Rails 邮件模板中使用 link_to 创建的链接不可点击
问题描述
在我的邮件中,我正在形成如下链接
class CustomerMailer < ApplicationMailer
def magic_login_email
customer = params[:customer]
@customer_login_url = magic_login_url(customer.authentication_token)
mail(to: customer.email, subject: "Here's your login link")
end
end
我在模板中使用它如下
<html>
<head>
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
</head>
<body>
<h1>Here's your login link</h1>
<p>
You have successfully signed up.<br>
</p>
<p>
To login to the site, just follow this link: <%= link_to 'Log in now', @customer_login_url %>.
</p>
<p>Thanks for joining and have a great day!</p>
</body>
</html>
但是当我在 gmail 中打开这封电子邮件时,我无法点击链接。该链接似乎是文本。谁能帮我解决这个问题。提前致谢。
解决方案
推荐阅读
- netlogo - rnd:weighted-one-of-list work 不会返回我认为应该的分布
- r - 循环和条件的问题。在值应该有效时将其标记为无效
- jquery - jQuery .find('li').length 必须来自兄弟/孩子?
- java - 尝试构建 Rest 服务时 Spring Boot 失败
- r - 根据第二个数据帧 R 上的索引替换数据帧中的值
- vba - 如何将记录信息从 ListBox 存储到 Table?
- java - 一旦我在函数之外,优先队列中的值就会被删除,为什么?
- android - 如何使用 popBackStack() 返回到我的 Android 应用程序中的上一个片段?
- python - 密码包含特殊字符时“拒绝用户访问”
- mysql - MySQL 合并 2 个结果集,不包括第一个中的记录