Joe*_*ers 5 email ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1 mailboxer
我刚刚gem 'mailboxer'在我的Rails 3.1.1应用程序中安装了Mailboxer()...我有电子邮件通知工作.
我按照这些说明自定义用户通过我的应用程序上的邮箱引擎发送新邮件时收到的通知电子邮件...这允许我编辑他们收到的电子邮件的内容,但我想更改"主题"在电子邮件标题中,从默认的"邮箱新邮件:"到自定义主题.
我假设可能有一行我可以添加到mailboxer.rb配置文件中?!?!?
任何人都可以帮忙吗?
只需更改你的en.yml文件并设置你自己的主题:
mailboxer.message_mailer.subject_new
mailboxer.message_mailer.subject_reply
Run Code Online (Sandbox Code Playgroud)
"subject"var包含邮箱消息主题.例如:
en:
mailboxer:
message_mailer:
subject_new: 'Hey, you receive a new message about %{subject}'
subject_reply: 'Hey, you receive a new reply about %{subject}'
Run Code Online (Sandbox Code Playgroud)
PS:任何时候你都可以在控制台上测试结果:
I18n.translate("mailboxer.message_mailer.subject_new", :subject => "hello")
Run Code Online (Sandbox Code Playgroud)
*只需更改您的实际主题的"你好"
所以,我完全错过了这个明显的...只需要添加一个自定义邮件,然后你就可以完全控制.
将以下内容添加到mailboxer.rb配置文件中:
Mailboxer.setup do |config|
config.notification_mailer = CustomNotificationMailer
config.message_mailer = CustomMessageMailer
...
end
Run Code Online (Sandbox Code Playgroud)
正如维基明确指出,在这里.
| 归档时间: |
|
| 查看次数: |
1775 次 |
| 最近记录: |