Topic: Receive a notification when the user open an email - Ruby On Rails

I building an application using rails, and I wanna know if is possible to write a code which allows me to be notified or something like that when the user open an email sent through my application. I need to track that information. When I sent an email, I need know. The question to be answered by my app is "Did they read it?"

Tips in others languages would be ok to me!

Thanks in advance, and sorry for my bad English smile)

Last edited by giovanni.lima (2011-12-17 01:37:00)

Re: Receive a notification when the user open an email - Ruby On Rails

You can do it,  but not with 100% certainty you will always get a notification.

There are two SMTP standards  DSN and MDN,  but they are both in effect optional,  you have no guarantee that the email system your targeted email recipient uses implements them.

The easiest thing to try is to put in a "Return-Receipt-To:" (RRT) email header.  Put some address as the content of the header. When a user opens an email message containing this header, the client's email reader will probably prompt the user whether or not to send a return receipt, if he complies,  an email will be sent to the address you specify.

That's pretty easy to to in rails,  you could do something like:

mymailer < ActionMailer::Base
   def need_reply
     headers['Return-Receipt-To:'] = 'readnotify@yoursite.com'
     mail(:to => 'prospect@bigcompany.com')
   end
end

If you want to you can set up rails to read these emails as well,  or you can just use an email address you monitor and read them manually.

Again,  THERE is NO GUARANTEE you will always get an acknowledgment !!!

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Receive a notification when the user open an email - Ruby On Rails

Also,  if it's REALLY important that you get return receipts,  you could also check each email domain, because many of the big free email providers have proprietary methods of requesting a return receipt, i.e. yahoo, if you  add ".readnotify.com" onto the end of your recipient's email address: for example - prospect@yahoo.com.readnotify.com , you'll get a return receipt.

You'd have to research all the big ones,  gmail, etc.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Receive a notification when the user open an email - Ruby On Rails

Thank you so much, I'll try it. smile)