def no_products_2
@users = [].tap{|users| User.created_days_ago(2).each{|user| users << user if user.buyer_products.empty?}}
sent_mail = [].tap{|sent_mail| @users.each{|user| sent_mail << (mail to: user.email, subject: "You Haven't Submitted Any Designs Yet")}}
end
My intent is to send emails to a collection of users from one Mailer method. I believe this is working fine, but I'd like to be able to ensure that all emails are being sent with a test. To that end, I'm trying to return an array of all sent messages, but it seems that mailer methods will always return the last Mail instance that was sent.
Any ideas? Do I need to assemble my collection of users and then iterate over them OUTSIDE of the mailer, thereby sending one email at a time from the actual function described above? Or is there a way to do all this inside the mailer function and test that all emails are being sent?