Keeping Track of campaign, strange behaviour from gmail - asp.net-mvc

I know question I am going to ask is not related to programming, but I dont know where to put this question so i am asking it here.
I am working on sending campaign to newslettersubscriber. I want to keep track of the email opened count to know the response from our customers. Technology I am using is ASP.NET MVC3 , SQL Server 2008. I have token in my email template(campaign) which is replaced by one specific url, which isDisplay images below image is downloaded.And method in my common controller is called and corresponding row is updated.
Now after this email is sent to customers. when i sent opened my own GMAIL inbox and opened this campaign. I inspected html element. but markup i saw was diffrent from my original url
Image
Is should <img src="http://www.mysite.com/common/EmailViewedNotificationHandler?id=30-E1663091-8849-442D-81C1-0DDE97771B55"
But interpreted as
<img src="https://ci5.googleusercontent.com/proxy/WnpVRMliHHhtbOu6y6GmZD4l4kVePPdRWR4BTNQY_OLeQ2IFJOJHwuvy2qThpWJUQBKpA7hmf09pkxDfnfQCszDDs2YHfIWd3iqGRMpsD6cNXO0UTLf4BN6Cbj43KfDkaCVrlwIZl-B0y8LlrWvjaheDRhd_f2ryjpib_c8f4K4=s0-d-e1-ft#http://www.mysite.com/common/EmailViewedNotificationHandler?id=30-E1663091-8849-442D-81C1-0DDE97771B55"/>
This was the case for my first campaign but with second campaign event this url wasnt there it was only <img>
By Gmail
Any Solutions
Thanks In Advance

This is new for Gmail but it pretty much screws you over for tracking an email campaign in Gmail. Google now caches images in emails and displays the cached versions to users (the URL you're seeing is to a Google caching server). This means that you will likely receive only one and exactly one request for each image in each email you send since Gmail will have to make a request to your server for the initial caching.
But to be honest you couldn't count on Gmail for accurate campaign tracking anyway since they moved to the "smart inbox" system that is supposed to automatically prioritize your inbox. I'm not sure what else Google has done to anger email marketers but the ones I work with really don't like Gmail.

Related

Custom email tracking not sending request when opened in Gmail

I´m trying to develop a custom email tracking system for my Rails webapp following the pixel approach. If I understood it right, the idea is to insert a one pixel image with source to a url that process the request. In my case, when the request is process it sends a new notification email to me.
In the email body I have inserted:
<img src="localhost/api/to?trackId=<%= id %>" style="display: none"/>
When I open the email in web Gmail with Chrome, I see next code, but unfortunately nothing happens:
<img src="https://ci4.googleusercontent.com/proxy/ncea8tesMNBOixfbJrQ1VL458oukzkLaIlWW6RbqedZ9mkMjsfgeIAWa5EWXcX4HOi0vLwDmFg=s0-d-e1-ft#http://localhost/api/to?trackId=1435" style="display:none;outline:none;text-decoration:none;height:auto!important;border:0" class="CToWUd">
When I just type the url directly in my browser, like: http://localhost/api/to?trackId=1435 my server gets the request and process it perfectly.
I have read in some other posts that Gmail is proxing the image and this is not working anymore. However, I think there should be one approach if there are lots of mail tracking services.
Do I have a mistake in my code, or should I try another approach?
Google replaces all images with copies in their cache. This copy cannot be retrieved from your localhost obviously.

Rails and email openened notifications

I am developing an application on Rails and I need to know if its possible to write code which will notify me when the user opens an email that has been sent from my application (need to track this info) ?
The main bit of data I need is was it opened.
thanks
You can do this but there is no 100% certainty you will always get a notification.
SMTP has 2 standards, they are DSN and MDN. Both are in effect optional, there is no guarantee that the email system of the targeted email recipient (your user) will implement them too.
The easiest way is to pit in a "Return-Receipt-To:" (RRT) email header. Put some address as the content of the header. Now when a user opens an email message containing this header, the clients email reader will msot likely prompt your users whether or not to send a return receipt. If the do comply and email will be sent to the address you specified.
In Rails it could be something like:
themailer < ActionMailer::Base
def notify_read
headers['Return-Receipt-To:'] = 'notifyread#mysite.com'
mail(:to => 'users#somecompany.com')
end
end
You could just use an email address you monitor and read them manually OR you could set up rails to read these emails as well. But there is no guarantee you will ALWAYS get an acknowledgment.
Additionally you could check each email domain, many of the big free email providers have proprietary methods of requesting the return receipt. If you add ".readnotify.com" onto the end of your recipients email address you will get a return receipt. You will have to research all the big ones though.
For example:
user#yahoo.com.readnotify.com
Hope that helps
Source: http://railsforum.com/viewtopic.php?pid=147997#p147997
A common way of implenting this is to include a link to an invisible image file, with the link including sufficient details about the email for you to be able to identify which email is being viewed.
When the image is requested by the mail client, your server can then record the viewing attempt. If you use a 3rd party email provider (such as sendgrid, postageapp) then sometimes they'll do that for you and ping your server with the appropriate event. I strongly suspect that this is what readnotify is doing under the hood (someone took the trouble of looking at this a while ago
This isn't completely accurate as some (many?) users turn off remote image viewing in their mail viewers.

iOS app creates email...is there a way to not have a copy of it in the sent folder

My app creates an email that can have sensitive data in it (depending on the users perspective). Is there a way on the iphone's email client not save a copy in the Sent folder.
And in the same way, if the user choses they can send it via text..is there a way to not have it be in the Message streams.
I'm thinking there is not but I'd love confirmation of this if possible. I've been scouring but can't seem to tell if it's possible.
Thanks.
I'll break this into two parts:
Not putting a copy of a sent message in the sent folder:
There's no easy way to do this since you don't have access to a user's mail. You could have the user enter their email service's IMAP details and write your own mail sending implementation that then goes and deletes the sent message from the server, but it's possible that mail clients would keep a local copy regardless of what happens on the server if they grab the message before you delete it. Regardless, this is a really terrible user experience (having the user enter IMAP details, not using the built in mail composer) and it'd be difficult to write (and you would need to be insanely careful about deleting something from a user's mailbox, and you'd have to ask them if it's okay to do so).
Not showing a text message in a Messages app conversation stream:
There's actually a way to do this. Text messages can be sent to users via a specially formatted email address that's different for every cell service provider. For example, to send a text to a Verizon subscriber it'd be 5551239876#vtext.com. For this solution to work you'd need to send the message using some sort of automatically generated email address that you retrieve from a mail server you've created, and then you'd need to implement your own SMTP mailer on the device. Of course, a user can always request text message transcripts from their cell service provider (and some have easy access online) and there's no way around that.
How sensitive is this information? Email and text message aren't very secure protocols. You may want to consider alternative methods that provide encryption and authentication mechanisms.
No its not possible if you are using the built in mailer in iOS. Something you could do if you wanted to get around this would be to make a customer mailer, send the information to a server and send off the mail through code but this is quite a bit more work.

How can I integrate internal messaging with emails in asp.net?

in github when a user sends you a message two things happen. You get a "new Message" on your github dashboard and you receive an email.
if you reply to that email it triggers a new Github message internally... so the users can actually have a full conversation through their email client without going into github even though Github is managing it all.
I know Malgun/Sendgrid have apis to manage receiving of emails (they send a POST request to your app when an email is received) but I need a little more info on how to do it... how exactly can I set up my app so that when a user receives a message they can just hit reply on their favorite email client while still maintaining track of that conversation. (they can still check their messaging history through my site)
Does anyone have an idea how exactly they do it?
Please help.
How this is implemented really depends on how you can handle incoming messages. If you're able to receive your emails as a POST to your application, then the email is really no different to a user sending the message on your site, you just need to parse the From: header from the email, and look up the user, and strip the fluff out of the email.
If you're writing your own code to handle the emails (eg. that polls a mailbox), then you could just POST them over to your app in the same way, or parse them up and POST more structured data.
Once you have the data, it's easy to construct a message and write it to your DB (and fire off email notification to the user, remembering to set the Reply-To: or From: headers so your script gets the replies). Most of these kind of messaging systems don't keep track of conversations/threads, but just store a string subject (and use "Re: ...") to keep things simple, though you could obviously add this if you're feeling ambitious!
If you're doing this, you should be security in mind - malicious users may POST to your email script, and email headers can easily be forged. Spammers will also use any possible scripts they can find to relay mail through other peoples servers.

Emails sent from postfix via a Rails app are getting sent to spam in gmail

When using 'mail' command to send email to a gmail user, the email goes through fine. When sending an email using a Rails app, the email is sent to the spam folder for the gmail user. Can someone help me think through this?
Emails landing in SPAM can happen due to many reasons:
Wrong Mail Server setup: Checkout here on how to setup
Email content: Content of the email can also invite SPAM. Sites like SpamCheck helps to check whether the content of the email is ok.
As mentioned by #Noli above, using services like Sendgrid, Critsend etc for sending out emails, chances of landing them in Inbox will be more. You can use them as relay servers from Postfix. But the first two steps are anyway necessary.
Use Mailchimp if you want to sent emails to many people, for eg: for sending out newsletters, marketing emails etc.
Mail deliverabillty is extraordinarily hard to get right. You should consider leaving this to the specialists like Sendgrid or Mailchimp, and not spend tooooo much development time thinking about it
Another thing to check is that if this is a new server, you may need to set up Domain Keys to authenticate to Gmail. This happend to me and I was able to get my mail removed from the spam folder by following these:
https://help.ubuntu.com/community/Postfix/DomainKeys
https://help.ubuntu.com/community/Postfix/DKIM

Resources