Is there a way to check open/click rates, bounces of emails via Rails? - ruby-on-rails

I'm currently trying to send emails from a Rails application and would like to check the open/click rates of these emails. (without using any web service) Is there a gem or plugin that I can use to help me find out? Or is it even possible to do this?

Take a look here:
http://www.codingforums.com/archive/index.php/t-122920.html
I think the first mentioned method, detecting how many times an image has been viewed would be the easiest. Then again, these are not exact solutions, but I think an exact solution would be sort of a security hole (i.e. sending an HTTP request to a foreign server once you open an email).

Varatis is correct, using image tracking is the most common way this is done, and it is the way that most web services provide you with analytics on the e-mails they send on your behalf. Here is another Stack Overflow question that includes an example of how you might do this in Rails.

Related

How to use Priority API?

I'm trying to create a simple application that reminds me of two weeks before I was supposed to get a delivery. My data is store in a Priority database and I'm looking for a way to read it using code (prefer in Python).
I read about Priority REST API and tested it with the examples that are in the site(https://prioritysoftware.github.io/restapi/request/). it seems like this is the way to do it but I see that it requires a URL to the Priority account and I don't know what is my URL because I use the desktop app.
So I have 2 questions:
Is using the API is the best way?
how do I find the URL to my account?
In addition I would be happy for further help regarding my idea for a program reminiscent of two weeks before receiving a delivery (examples, tips, ways to implement and so on).
Thank in advance
In order to use Priority API you need to install its application server.
More information can be found here.
If you are working locally you can access carefully directly to your SQL server and look for your data.
Priority has built-in functionality to send email reminders (BPM rules)

Mandrill - View In Browser Functionality

This question was discussed about 2 years ago.
Do we have any feature built-in Mandrill since then to cater to the requirement mentioned in that link of displaying every email sent through Mandrill in browser by adding a "View In Browser" link? If not, then I am leaning towards implementing something similar to what #Muleskinner did (again mentioned in that link as one of the responses). Please let me know what you guys think about it?
Would strongly recommend using a full-featured templating service on top of mandrill (we use sendwithus. Services like that provide a templated URL that can power this sort of thing, and you won't have to worry about building and hosting the templates yourself.
Finally I have managed to implement the requirement mentioned above. Explanation below for anyone else looking for help on the same subject:
Mandrill still DOES NOT have any such feature out of the box. So we need to implement this on our own. What I am doing is immediately after sending every email through Mandrill, I call its Render method which gives the resultant parsed template in HTML with all customers' information and storing it in the system for future use.

Receive notification when site server adds page

I've been doing some programming off and on for my brother, who is a stock trader. I'm wondering if it is possible to receive a push notification when a site server adds a page. For example, the site smallcapfortunes.com frequently adds pages that are simple extensions off the main URL. For example, the site regularly adds pages under URLs such as /neca/, /stev/, etc.
Are there existing methods to execute this? Or is this something I need to write myself? Has anyone here written anything like that?
I know there are existing sites to track basic updates to a single page. In my research, though, I haven't found anything like this.
Please let me know if there are any other details I need to provide.
Generally you can only get a push notification if a specific website offers that service.
Some websites publish a structured (XML) site map. If the one you're interested in does that, you could pull that sitemap on a regular basis and look for differences.
you're most likely going to want to use http://scrapy.org/ to go through the site and find new /neca/ and /stev/ urls, etc, then just trigger the script every so often.

how do I block my rails app from being hit by bots?

I'm not even sure I'm using the right terminology, whether this is actually bots or not. I didn't want to use the word 'spam' because it's not like I have comments or posts that are being created/spammed. It looks more like something is making the same repeated request to my domain, which is what made me think it was some kind of bot.
I've opened my first rails app to the 'public', which is a really a small group of users, <50 currently. That was last Friday. I started having performance issues today, so I looked at the log and I see tons of these RoutingErrors
ActionController::RoutingError (No route matches "/portalApp/APF/pages/business/util/whichServer.jsp" with {:method=>:get}):
They are filling up the log and I'm assuming this is causing the slowdown. Note the .jsp on the end and this is a rails app, so I've got no urls remotely like this in my app. I mean, the /portalApp I don't even have, so I don't know where this is coming from.
This is hosted at Dreamhost and I chatted with one of their support people, and he suggested a couple sites that detail using htaccess to block things. But that looks like you need to know the IP or domain that the requests are coming from, which I don't.
How can I block this? How can I find the IP or domain from the request? Any other suggestions?
Follow up info:
After looking at the access logs, it looks like it's not a bot. Maybe I'm not reading the logs right, but there are valid url requests (generated from within my Flex app) coming from the same IP. So now I'm wondering if it's some kind of plugin generating the requests, but I really don't know. Now I'm wondering if it's possible to block a certain url request, based on a pattern, but I suppose that's a separate question.
Old question, but for people who are still looking for alternatives I suggest checking out Kickstarter's rack-attack gem. Allows not only blacklisting and whitelisting, but also throttling.
These page seems to offer some good advice:
Here
The section on blocking by user agent may be something you could look at implementing. Is there anyway you can get the useragent from the bot from your logs? If so look for the unique aspect of the useragent that probably identifies the bot and add the following to .htaccess replacing the relevant bits
BrowserMatchNoCase SpammerRobot bad_bot
Order Deny,Allow
Deny from env=bad_bot
Its detail on that link in more detail and of course, if you can't get the useragent from your logs then this will be of no use to you!
You can also update your public/robots.txt file to allow/disallow robots.
http://www.robotstxt.org/wc/robots.html

How do I make yahoo unblock the images that come with the emails coming from our server?

How do I make yahoo unblock the images that come with the emails coming from our server?
For HTML email, which is a wild beast at the best of times, you should be using some kind of starting template before embarking on any sort of customization. There are a number of examples out there that are excellent reference but Campaign Monitor has made a serious effort to promote best practices.
http://www.campaignmonitor.com/templates/
It may be helpful to use an email previewing service like Litmus to verify your messages are being transmitted as intended:
http://litmusapp.com/email-testing
Is it all yahoo users or just some? Many users turn off images in email for privacy reasons (to prevent companies from using image requests as a confirmation that someone got an email.)

Resources