【发布时间】:2015-02-28 04:46:30
【问题描述】:
我有一个带有来自 NAME 的变量的 ActionMailer,因此我想测试该名称是否正确设置。
简而言之:
def test_email()
mail({
:from => '"John Smith"<john@smith.com>'
})
end
如果我随后生成一个邮件并尝试访问来自...
$ m = UserMailer.test_email
$ m.from
=> ["john@smith.com"]
我只是得到电子邮件地址。如何访问“John Smith”部分?
【问题讨论】:
-
你能试着像这样格式化
from:吗?'John Smith <john@smith.com>'?
标签: ruby-on-rails ruby actionmailer