Ruby on rails 3 设计用于重置密码的邮件模板

Ruby on rails 3 设计用于重置密码的邮件模板,ruby-on-rails-3,devise,Ruby On Rails 3,Devise,我想添加附件的电子邮件发送重置密码的设计(标志图像),而且我想使用用户的地区来本地化电子邮件文本。 有谁能帮我一下,告诉我要覆盖什么来完成这项工作吗?只需运行rails生成designe:views并在app/views/designe/mailer/reset\u password\u instructions.html.erb中编辑模板,您需要将徽标图像作为附件添加 为此,请按照链接中的说明覆盖默认的Desive::Mailer: 然后,使用附件.inline['logo.png']=添加

我想添加附件的电子邮件发送重置密码的设计(标志图像),而且我想使用用户的地区来本地化电子邮件文本。
有谁能帮我一下,告诉我要覆盖什么来完成这项工作吗?

只需运行
rails生成designe:views
并在
app/views/designe/mailer/reset\u password\u instructions.html.erb
中编辑模板,您需要将徽标图像作为附件添加

为此,请按照链接中的说明覆盖默认的Desive::Mailer:

然后,使用附件.inline['logo.png']=添加附件:

def reset_password_instructions(record, opts={})
  attachments.inline['logo.png'] = File.read('app/assets/images/logo.png')
  super(record, opts)
end
在视图中,您可以使用
附件['logo.png'].url

<%= image_tag(attachments['logo.png'].url, alt: 'Logo') %>

我正在为rails 5应用程序使用Desive 4.3。需要附加参数

 def reset_password_instructions(record, token, opts={})
    attachments.inline['logo.png'] = File.read("#{Rails.root}/app/assets/images/logo.png")
    super(record, token, opts)
 end

但我不能以这种方式添加图像。我只收到坏链接,当我试图这样做。我必须在邮件中添加一个附件-我怎么做?