Is there a gem to do this, and if not, what is the best approach. I’m assuming i’d store the emails in a newsletter database, and would want a form that emails everyone at once. thanks!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No gem for this that I know of.
Actually, due to processing issues, the best way would be to use external bulk email service provider via provider’s API.
However, building your own newsletter system is no different from building your regular MVC. Only addition are mailers and mailer views.
(1) So you create model that deals with registration data (:name, :email, :etc…) and model that deals with newsletter itself.
(2) Controller that deals with it (CRUD) + (:send). Send takes each recipient, sends data to mailer which creates email and then sends it.
(3) Mailer builds an email, makes some changes in each email if you want to do something like that and returns it to controller action send for delivery.
(4) Ofc, you need mailer views which are just like regular views. Well in multipart there is:
newsletter_email.txt.erb
When you want to send both html and text only emails. Instance variables are defined in mailer ofc.
And… that is it. Well you could use delayed job to send them since sending more than several hundred emails can take a while. Several ms times n can be a lot of time.
Have fun.