4 ms·
Have you read the official docs? http://guides.rubyonrails.org/action_mailer_basics.html http://guides.rubyonrails.org/action_mailer_basics.html 2.3.3 Sending
by dchuk 9y ago
Have you read the official docs?
http://guides.rubyonrails.org/action_mailer_basics.html http://guides.rubyonrails.org/action_mailer_basics.html
2.3.3 Sending Email To Multiple Recipients
It is possible to send email to one or more recipients in one email (e.g., informing all admins of a new signup) by setting the list of emails to the :to key. The list of emails can be an array of email addresses or a single string with the addresses separated by commas.
class AdminMailer < ApplicationMailer
default to: Proc.new { Admin.pluck(:email) },
from: 'notification@example.com'
def new_registration(user)
@user = user
mail(subject: "New User Signup: #{@user.email}")
end
end
The same format can be used to set carbon copy (Cc:) and blind carbon copy (Bcc:) recipients, by using the :cc and :bcc keys respectively.
As for Devise, it's not a part of Rails, and there are a few alternative auth gems you can use, so it's not really a valid criticism of the framework if the thing you don't like isn't in the actual framework.