Is there a bulk email plugin for Rails apps? - ruby-on-rails

Does anyone know of a plugin or something that can be used to send bulk emails for a Rails app?
Specifically, I'd like to be able to pass an HTML email file to a rake task or something and have it emailed out to everyone who has signed up to my site and checked the "please send me info about XXX" box.
I wrote kind of a hacked-together version for myself, but I'd like something that throttles itself somewhat smartly and can pick up where it left off if interrupted.
Update: I eventually broke down and got out my credit card and signed up for a real bulk email service, and damn was that the right choice. The resulting emails are very professional, they have built-in analytics, also integrate with Google Analytics, and it's awesome for a ton of other reasons.
If you're looking to do bulk emails with Rails, I would suggest using the Mailchimp service (here's my affiliate link that has a bonus on signup) along with the hominid gem. This will allow you to sync all your user emails from your database to Mailchimp, then use a real bulk service instead of some crappy patched together one.
Another Update: I heard about Maktoub today, and it's pretty much exactly what I was describing. Disclaimer: I have never used it and would still probably steer clear and go with a paid service, but it's still probably better than rolling you own.

I couldn't find one so I wrote it myself. It's not pretty (at this stage), but should serve as a good starting point for anyone with similar needs.
Please send me a pull request if you make any beneficial changes and I'll make sure to give you credit.
Mailcar - Ruby on Rails mass / bulk email plugin
Update - I highly recommend using a service. Rolling your own is a real pain and it will be difficult to manage once your list becomes reasonably large at all.

I don't know that this is the kind of thing that can be covered by a plugin as there are whole sites/applications dedicated to this kind of thing. If you wanted to use one of those then there is www.campaignmonitor.com, it's pretty good and it has an api that you can hook into from your application.

You might want to take a look at postageapp.com

Not aware of any plugins for this and I don't know how rake could be used to do this, if at all.
Since you're using Rails, I assume you're using MySQL as your database so this may not be useful to you, but SQL Answers Mail for SQL Server sends bulk email directly from SQL Server. You could try searching for a tool that does something similar for the database you're using.
There's also a tutorial here and here on creating your own mailer.

use ActionMailer(tutorial) (docs), it comes with Rails and you should be able to rig it to run from a rake task.

There's a relatively new project called Maktoub which claims to be a Rails engine for email newsletters. I haven't tried it yet, but it looks promising.

Related

AI chatbot with Ruby on Rails

I would like to develop a chatbot directly inside my Rails app (maybe whatsapp/messenger in the future, but let's begin within my app first).
I've checked online but I find a lot of different ressources and I am not sure which tools I should use.
The chatbot is not for marketing purposes only, it should be able to interact with my controllers and give back some content to the user.
For exemple, I want the user to be able to ask "what is my balance?" or "show me my last transaction" or "how many bills do I have to pay this month?"
In the future I would like to use ML to make the bot "smarter" and make suggestions to the user, but that's not a priority.
What tools and what steps would you recommend to follow in order to achieve this?
Any gems you recommend? Any tutorial that could help?
Is it possible to do this inside my rails app and using Ruby?
I am ready to try by myself but the content I find on Google is messy and I want to know the best way to do this so I don't lose hours with software that are not really good..
Thanks for your help
You cannot configure bot inside your rails app but you can create separate rack for creating bot. stealth is good one.
Read doc for configuring it with rails.

securely storing login details to external services

I’m making an app that performs tasks on other sites for you.
Example - my app would login in to your theguardian.com account and check if you have any replies to your comments and perform an action if you do.
I'm wondering how I should store, and read, the login details for the guardian.com in my app? Obviously I want to avoid plain text.
I'm using rails and Postgres, my app is fully SSL.
EDIT:
I'm voting to close the question as it's obviously a bad idea and it looks like people are going to tell me so many times. #jvillian has suggested a gem which will help encrypt properties on a model if I do want to avoid plain text, which may be of use to anyone who stumbles across the question.
Check out attr_encrypted. I haven't used it personally, but it looks like what you're looking for and looks to be an active project.

What tools to use for a website with lots of "realtime" page updates (coming from a Rails background)?

We are planning to make a "large" website for I'd say 5000 up to many more users. We think of putting in lots of real time functionality, where data changes instantly propagate to all connected clients. New frameworks like Meteor and DerbyJS look really promising for this kind of stuff.
Now, I wonder if it is possible to do typical backend stuff like sending (bulk) emails, cleaning up the database, generating pdfs, etc. with those new frameworks. And in a way that is productive and doesn't suck. I also wonder how difficult it is to create complex forms with them. I got used to the convenient Rails view helpers and Ruby gems to handle those kind of things.
Meteor and DerbyJS are both quite new, so I do expect lots of functionality will be added in the near future. However, I also wonder if it might be a good idea to combine those frameworks with a "traditional" Rails app, that serves up certain complex pages which do not need realtime updates. And/or with a Rails or Sinatra app that provides an API to do the heavy backend processing. Those Rails apps could then access the same databases then the Meteor/DerbyJS app. Anyone thinks this is a good idea? Or rather not? Why?
It would be nice if anyone with sufficient experience with those new "single page app realtime" frameworks could comment on this. Where are they heading towards? Will they be able to handle "complete" web apps with authentication and backend processing? Will it be as productive/convenient to program with them as with Rails? Well, I guess no one can know that for sure yet ;-) Well, any thoughts, guesses and ideas are welcome!
For things like sending bulk emails and generating PDFs, Derby let's you simply use normal Node.js modules. npm now has over 10,000 packages, so there are packages for most things you might want to do on the server. Derby doesn't control your server, and it works on top of any normal Express server. You should probably stick with Node.js code as much as possible and not use Rails along with Derby. That is not to say that you can't send messages to a separate Rails app, but since you already have to have a Node.js app running to host Derby, you might as well use it for stuff like this.
To communicate with such server-side code, you can use Derby's model events. We are still exploring how this kind of code works and we don't have a lot of examples, but it is something that we will have a clear story around. We are building an app ourselves that communicates with an email server, so we should have some real experience with this pretty soon.
You can also just use a normal AJAX request or send a message over Socket.IO manually if you don't want to use the Derby model to do this kind of communication. You are free to make your own server-side only routes with Express along with your Derby app routes. We think it is nice to have this kind of flexibility in case there are any use cases that we didn't properly anticipate with the framework.
As far as creating forms goes, Derby has a very powerful templating system, and I am working on making it a lot better still. We are working on a new UI components feature that will make it possible to build libraries of self-contained UI widgets that can simply be dropped into a Derby app while still playing nicely with automatic view-model bindings and data syncing. Once this feature is completed, I think form component libraries will be written rather quickly.
We do expect to include all of the features needed for a normal app, much like Rails does. It won't look like Rails or work like Rails, but it will be similarly feature complete eventually.
For backend tasks (such as sending emails, cleaning up the database, generating pdfs) it's better to use resque or sidekiq
Now, I wonder if it is possible to do typical backend stuff like
sending (bulk) emails, cleaning up the database, generating pdfs, etc.
with those new frameworks. And in a way that is productive and doesn't
suck. I also wonder how difficult it is to create complex forms with
them. I got used to the convenient Rails view helpers and Ruby gems to
handle those kind of things.
Also, my question is not only about background jobs, but also about stuff one can might do during a request, like generating a pdf, or simply rendering complex views with rails helpers or code from gems. –
You're mixing metaphors here - a single page app is just a site where the content is loaded without doing a full page reload, be that a front end in pure js or you could use normal html and pjax.
The kind of things you are describing would be done in a background task regardless of the fornt-end framework you used. But +1 for sidekiq if you're using ruby.
As for notifying all the other users of things that have changed, you can look into using http://pusher.com or http://pubnub.com if you don't want to maintain a websocket server.

Share session between phpBB and a rails app

This might be a nonsensical question, but I have this task to create a rails app that shares session information, specifically login/authorization info, with an installation of a phpBB that some other person has customized to be more than just a BB.
Basically I need to rely on the user's phpBB login to authorize access to the rails app. I really don't want to have the user maintain two logins to use this conceptual single app.
I read a lot of documentation on phpBB and didn't find anything like exposed services or an API, but I'm hoping I just missed something obvious.
I've been considering adding a method to expose some hash or something to link the two applications rather than try to squeeze possibly different implementations of session.
Quick context, this work needs to be done fast and cleanly and I've never developed in php and rails is super fast so I am investigating the idea of integrating the two sides.
I might be off in the weeds, so don't be afraid to say so :)
thanks!
Have you checked phpbb-auth?
https://github.com/mattfawcett/phpbb-auth

How do I develop a web page that returns password for users to register?

I am doing a project on creating a lab application for a next generation sequencing data using ruby on rails.
The main idea my boss suggests me to do is to have users fill in their details and submit to us. After the submission, the administrator, i.e. me, would send them a password which they can use to login my application. could some one help me with the idea of development. I am naive to ruby on rails and would be very grateful for people who help me.
thank you and cheers
I would start with Michael Hartl's RailsTutorial. Not only did I find it the best way to get started - the application he builds includes a bombproof user security model, just as you require, and so you'd be both learning and developing something relevant at the same time.
I'd also recommend buying the videos, as well as the book. They make all the difference.
Are you new to the whole web development thing or is it just Ruby on rails that you have no knowledge of?
If the former, I'd suggest googling some Ruby tutorials on how to make a simple web application and build from there. Start by a simple "Hello world" application, then proceed to handle submitted forms, then install and use a database and by then you should have the basic knowledge to build what you want.
If the latter, could you specify, what parts you need help with? Ruby is syntactically quite easy to learn if you just take a look at some tutorials, so that shouldn't pose any problems. You have described a simple use case which I'm sure you can handle in a new environment, if you just have the patience to try and learn.

Resources