How to send multiple emails with SendGrid?
问题 The following code seems to work if there is one user, but truncate the email for multiple users: users.each do |user| mail( :to => user.email, :subject => 'Hi', :template_name => 'notification' ).deliver Is this the proper way to send a few emails? Ruby on Rails 3.2.2 Heroku SendGrid 回答1: I think this is what you're looking for: def my_mailer_method users = User.find({ ... }) headers['X-SMTPAPI'] = { :to => users.to_a }.to_json mail( :to => "this.will@be.ignored.com", :subject => "Hi",