Skip to content
Browse files

Action Mailer guide update: the :to parameter now supports both Strin…

…g and Array values to indicate recipients.
  • Loading branch information...
1 parent 073d9ff commit 92d3b51bc0b706eaa75c635a1b21a055635373e0 @raul raul committed with fxn
Showing with 2 additions and 2 deletions.
  1. +2 −2 railties/guides/source/action_mailer_basics.textile
View
4 railties/guides/source/action_mailer_basics.textile
@@ -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)

0 comments on commit 92d3b51

Please sign in to comment.
Something went wrong with that request. Please try again.