提交 169a5093 编写于 作者: R Raul Murciano

Action Mailer guide update: the :to parameter now supports both String and...

Action Mailer guide update: the :to parameter now supports both String and Array values to indicate recipients.
上级 ac4dc5e2
......@@ -242,11 +242,11 @@ end
h5. Sending Email To Multiple Recipients
It is possible to send email to one or more recipients in one email (for e.g. informing all admins of a new signup) by setting the list of emails to the <tt>:to</tt> key. The <tt>to:</tt> key however expects a string so you have join the list of recipients using a comma.
It is possible to send email to one or more recipients in one email (for e.g. informing all admins of a new signup) by setting the list of emails to the <tt>:to</tt> key. The list of emails can be an array of email addresses or a single string with the addresses separated with commas.
<ruby>
class AdminMailer < ActionMailer::Base
default :to => Admin.all.map(&:email).join(", "),
default :to => Admin.all.map(&:email),
:from => "notification@example.com"
def new_registration(user)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册