I''ve seen some discussions already in the mailing list about sending Mass Emails in Rails, but they''ve been pretty unsatisfying. I''m working with a non-profit with a low budget. They''d like to save money on email communication by building a tool that will allow them to send out graphic emails through their site. The hitch is that the web host has an SMTP throttling limit of 50 recipients/blast and 500 recipients/hour. Their mailing list is just over 500 recipients. Someone suggested I use a combination of BackgrounDrb and ar_mailer to feed the emails into a database and cycle through a portion of them every few minutes. But I''m an intermediate Rails developer and I couldn''t make heads or tails of some the documentation on those two tools -- especially ar_mailer. Can anybody provide a better solution or a tutorial/walkthrough on using BackgrounDrb and ar_mailer together? P.S. The answer is not to BCC everyone on the mailing list. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi there, I''ve successfully implemented ar_mailer, and it works well. All emails get queued into a database table that looks like this: create_table :emails do |t| t.column :from, :string t.column :to, :string t.column :last_send_attempt, :integer, :default => 0 t.column :mail, :text end To get your emails going into this table, you subclass your mailer classes from ARMailer, like this: class NotificationMailer < ActionMailer::ARMailer end Now, when you tell your rails app to deliver an email, it actually just gets queued into that table. Now you need some sort of background process to check this table periodically. I handled this by making a little rake task to send out the emails from the queue, like this: desc "Send queued emails" task :send_queued_emails => :environment do Dir.chdir(RAILS_ROOT) # change working directory to rails app root so ar_sendmail will work correctly ActionMailer::ARSendmail.run([''-o'']) end Then I setup a little cron job to run every 15 minutes which runs the rake task and send out the emails... 15,30,45,59 * * * * /usr/bin/rake -f /your/rails/app/current/Rakefile send_queued_emails RAILS_ENV=production >/dev/null 2>&1 Not only that, this domain has all mail sent through GMail servers. Works great. -- Scott Becker Electro Interactive, Inc. Office: 813-333-5508 Web: http://electrointeractive.com Blog: http://sbecker.net On 5/30/07, NewMonarch <jscrawford-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''ve seen some discussions already in the mailing list about sending > Mass Emails in Rails, but they''ve been pretty unsatisfying. > > I''m working with a non-profit with a low budget. They''d like to save > money on email communication by building a tool that will allow them > to send out graphic emails through their site. The hitch is that the > web host has an SMTP throttling limit of 50 recipients/blast and 500 > recipients/hour. Their mailing list is just over 500 recipients. > > Someone suggested I use a combination of BackgrounDrb and ar_mailer to > feed the emails into a database and cycle through a portion of them > every few minutes. But I''m an intermediate Rails developer and I > couldn''t make heads or tails of some the documentation on those two > tools -- especially ar_mailer. > > Can anybody provide a better solution or a tutorial/walkthrough on > using BackgrounDrb and ar_mailer together? > > P.S. The answer is not to BCC everyone on the mailing list. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, On 30/05/07, NewMonarch <jscrawford-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''ve seen some discussions already in the mailing list about sending > Mass Emails in Rails, but they''ve been pretty unsatisfying. > > I''m working with a non-profit with a low budget. They''d like to save > money on email communication by building a tool that will allow them > to send out graphic emails through their site. The hitch is that the > web host has an SMTP throttling limit of 50 recipients/blast and 500 > recipients/hour. Their mailing list is just over 500 recipients.if you don''t mind to use PHP, there is great free mailing list tool ''PHPList''. Interfacing with a Rails application should be easy. -Thomas --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> class NotificationMailer < ActionMailer::ARMailer > endHi, could you give some same of NotificationMailer class? bec''z i have sample of email.rb is: class Email < ActionMailer::ARMailer def testmail recipients "mymailaddress-9IKiO1iGCm/QT0dZR+AlfA@public.gmane.org" from "fromaddress-9IKiO1iGCm/QT0dZR+AlfA@public.gmane.org" subject "TEST MAIL SUBJECT" body "<br>TEST MAIL MESSAGE" content_type "text/html" end end and i am sending it through controller like: mail = Email.create_testmail # => a tmail object Email.deliver(mail) but error is occurring: undefined method `create'' for Email:Class and when i run ar_sendmail -o, it throw error like: Unhandled exception undefined method `destroy_all'' for Email:Class(NoMethodError): it means it does not consider mail as active record. please help -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> could you give some same of NotificationMailer class?sorry for typo: could you give some sample of NotificationMailer class? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hello Rajesh, I have exactly the same problem. Did you find a solution to this? Thanks in advance. marlor Rajesh Soni wrote:>> class NotificationMailer < ActionMailer::ARMailer >> end > > Hi, > could you give some same of NotificationMailer class? > > bec''z i have sample of email.rb is: > > class Email < ActionMailer::ARMailer > def testmail > recipients "mymailaddress-9IKiO1iGCm/QT0dZR+AlfA@public.gmane.org" > from "fromaddress-9IKiO1iGCm/QT0dZR+AlfA@public.gmane.org" > subject "TEST MAIL SUBJECT" > body "<br>TEST MAIL MESSAGE" > content_type "text/html" > end > end > > > and i am sending it through controller like: > mail = Email.create_testmail # => a tmail object > Email.deliver(mail) > > but error is occurring: > undefined method `create'' for Email:Class > > > and when i run ar_sendmail -o, it throw error like: > > Unhandled exception undefined method `destroy_all'' for > Email:Class(NoMethodError): > > it means it does not consider mail as active record. > > please help-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---