Send multiple emails

27 views
Skip to first unread message

Paul Bergstrom

unread,
Jul 6, 2013, 3:06:33 AM7/6/13
to rubyonra...@googlegroups.com
Any problems sending a lot of emails with rails like this:

@members = Members.all
@members.each do |m|
MemberMailer.message(@message, m).deliver
end

--
Posted via http://www.ruby-forum.com/.

thiagocifani

unread,
Jul 6, 2013, 9:46:35 AM7/6/13
to rubyonra...@googlegroups.com
The major problem would be if you are a user and somehow when you signup or try to sendo those emails through some action, the server could return a timeout response, if you have a lot of users. What I recommend you to do is, put all mailers call inside a worker like sidekiq or sucker_punch. it will help a lot with rake tasks in and other piece of code in background jobs.

hope I have helped you.

nice day


2013/7/6 Paul Bergstrom <li...@ruby-forum.com>
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/766c4a5b29cab0bf62a784521c263ffb%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
thiagocifani
Reply all
Reply to author
Forward
0 new messages