Microsoft Graph API: How to detected if Mail has been moved from another folder into an observed one (Mail/Delta Queries/Subscription) - email

We currently migrating our .Net Application from EWS to Graph API using msgraph-sdk-dotnet
Primarily we are using message-delta Requests to observe mail folders in order to detect incoming mails. So far so good.
Migrating from EWS
When using EWS we were able to detect moved mail events/actions and to distinguish these mails from new incoming (new sent) mails. So far, we didn't figure out who this can be achieved by using MS Graph API.
About use cases
There are use cases where we must distinguish a newly sent email from a Mail which has been moved/dragged from another folder into the observed one manually by any user (via Outlook). This use case scenario includes the following flow: Let's say the inbox is the observed folder, a new incoming mail has been sent to the mailbox and the mail has been detected by our delta request observer.
Then the user decides to move this mail into another custom but not observed folder using Outlook. Finally, the user decides to drag this mail back into the observed folder. Now we'd like to have a solid strategy at hand to detect this mail as moved (not as sent or updated, we need to distinguish these states).
Hint: This flow demonstrates why we can't really rely on isRead: Users can use a client (e. g. Outlook) to mark an any mail as read, which is most likely the case when you drag a mail from folder to folder.
How to detected a moved mail?
Are there any properties from Mail Resource which can be used to identify if a mail has been moved specifically? Maybe something not mentioned in the public API documentation (ODATA, something which can be extracted by folderIds etc.?) or something which is supported by beta API version? Any ideas?
We also investigated the subscription resource but did not find a specific changeType which specifically reflected a moved mail.
How should we resolve these issues? Any ideas how to develop a solid detection strategy for moved mails using Graph API?
Thx for any hint, advice or help you can give

I have started looking at the lastModifiedDateTime property. It appears that when the message is first received, the lastModifiedDateTime is 1-2 seconds after the receivedDateTime. When the message is moved to another mail folder, receivedDateTime stays constant, but obviously the lastModifiedDateTime changes. I am still looking at the Microsoft docs to find everywhere the lastModifiedDateTime property is changed.

Related

TFS Work item solutions for attaching email communications

For a couple of days now I've been searching for a solution that integrates ongoing work item communication over email into a specific work item's history.
For example once a ticket is created, if a specific TFS email account is included in email correspondence related to a specific ticket, some service would parse the TFS email account, read the email contents and attach the conversation to the work item. I've seen other ticketing systems support similar functionality.
The major problem I'm trying to solve here is to increase productivity by automatically keeping all tickets in sync with related conversations without user intervention.
Does anyone know of any commercial or open source products that can support this functionality?
I just implemented a cloud service using SendGrid that accepts emails at [workitemid]#mycloudservice.com and appends the email to the History of the work item. So if you forward an email to 1234#mycouldservice.com, the email date/subject/body is appended to the History of work item ID 1234.
Right now I have a lot of things hard-coded to my personal usage, but I'm thinking of making it generic/configurable for public usage. The big caveat is that the TFS server needs to be internet-visible (works great with Team Foundation Service). I'll update this answer when(if) I open it up for general usage. The code that handles the SendGrid POST is here if you're interested.
There is also the TeamCompanion Outlook add-in, that gives you a button in the ribbon to attach the current email to a work item. The last round I went with TeamCompanion I found it OK, but a bit buggy, and it may have slowed Outlook down (or that could have been psychological).

auto sending mails by server at specific intervals

I am looking for some code, which I could send mails out of my website.
I want the user's registered in my website, to be able to automatically send emails at specific time, that's defined by the user. I need a triggering mechanism in asp.NET such that it fires the exact date & time as specified by the user
Any suggestions/approach apart from the above statement is also welcomed.
I have found a solution for the problem, and would kindly request the moderators to delete the post.
Thank you
Asp.Net is not the correct framework to perform scheduled tasks.
You can use Asp.Net for a web interface in which you allow the users to create "tasks", set the timed intervals and even the content of the emails.
BUT - The process which sends the emails should probably be done using a task scheduler...
Here is a post to point you in the right direction...

Keeping track of whether an email has been opened

I'm using rails 2 for this app, with ActionMailer, but this is a general question about emails.
When we send out emails, i save a record corresponding to the email in a database table. I'd like to keep track of whether people have read the emails, and am wondering the best way to do it. On initial googling, it seems like i've stumbled into an ongoing battle between spammers and email clients!
My first thought was to use the "read receipt" header, but i know that this isn't supported by a lot of clients and is therefore unreliable. After that, i read of the tactic of including an image in the mail, and of detecting that image being loaded. I was thinking that i could put a parameter with the email record's id in the image url, so that when i get a request for that image i can see if it has a (for example) email_id param and if so, mark the corresponding email as having been read.
But, then i remembered that many clients are wise to this tactic and specifically ask the viewer of the mail if they want to display images. Obviously they might say no.
Am i right in thinking that i can't pull in other resources, such as stylesheets, in my mail? Because if i can pull them in, i could do that same trick but with the stylesheet rather than an image.
Grateful for any advice, max
Externally-hosted stylesheets are generally treated the same way as images. The client will not download them without prompting the user, if that works at all with HTML-formatted emails.
One thing to consider- you're looking to determine whether the email was read, not necessarily just received, right? Format your email so that it can't be easily read without viewing the images, and include a "view in browser" link at the top. Track image and page-format views and I think you'll have a fairly reliable way to measure actual reads.
Bit late on this, but we've got a similar problem.
We're tracking the links to our site that are included within the email. We're doing this by, like you, having a DB record per email sent out. We've generated a unique hash key per email and are including that as a parameter on all the links included in the email.
We simply then have a before_filter that looks for the parameter and records the fact against the correct email record by using the unique hash to identify the correct one.
We use a unique hash key (rather than the DB's primary key) just so it is a little bit more secure / reliable.
Obviously this method only helps us track the clicks our emails have generated (and not if they've been read) but it is still useful as we can see which of ours users has clicked on which links.
We are having major problems with this as well.
We have task wek portal, where users create tasks (like paint my house) and then we invite painters to give the task creator an price on painting his house.
For that we had a very advanced email system, that sends an invitation and if they accept the invitation we send them the contact info of the task creator.
We need to be able to track if the email was opened, and then once it's opened, we know that the company got the contact info, and we can now send another email to the task creator, telling them that they can expect to be contacted by that company.
The problem is that tracking if the email was opened is not reliable at all. There are different systems for this like msgtag (which does not support a wide range of mail clients like yahoo and other major clients) and our email API client (elastic email) even offer some API call back functions to tell us if each email was opened or bounced or whatever. But again, it's not reliable. To track if it's open, elastic email just includes a 1x1 px image and track if it's opened. So if people don't click "show images in this email" it's not tracked as opened.
So basically we are down to two options.
Have vital portions of the content printed on images, that they have to view to get the info we want to track if they got (in this case contact info)
Just have a link in the email "click here to get the contact info" and then track if that is clicked.
So in conclusion, the "track if opened" is totally useless and unreliable, unless you can fully control which email clients your recipients are using and how they are using them (like if they are all your employees or something).

In salesforce, can you verify that an email sent by a workflow was opened by the recipient?

I am using a salesforce workflow to send out product information and invoices to clients but I am running into problems thinking of how to verify if a client receives the email and or opens it. Is there any way to prove that a client received my inventory list or invoice? Doing some prior research on this subject I have come across the following suggestions:
Adding a 1x1 invisible image to the email with a unique id
Adding a regular image instead of a 1x1, maybe company logo
Having the recipient click a link to see the invoice
With all these solutions, you have to detect image requests or link request for them and extract/produce a unique id for each client. I am not really sure how to do this in salesforce so any help would be appreciated, along with other detection ideas.
If you have Salesforce Content, there are some ways to expose documents to clients with the features you need. Basically you'll send an email with link and later you can track confirmation of opening, count how many times was it downloaded.. You can also set the expiration date to the document (can't be downloaded anymore after the date).
As for "pure" email from Apex/Visualforce and basically manually recreating the Content's functionality... nowadays most mail clients block external pictures unless explicitly allowed by the mail recipient, so I suspect you'll have poor track of emails marked as opened. Probably you could create a small Visualforce page (no header, no styles, just controller that makes update "invoice viewed" in the database). Display image from Documents on this page (make sure it's "externally available image") or even just display 1 pixel encoded in base64...

How does Litmus track their email analytics?

So, 'Litmus', a web app for testing emails and webpages across browsers and email clients, has a proprietary method that they claim is able to track not just opens, clicks, browsers, etc (standard with an embedded image and pass-through link tracking.)
What's unique is they claim that they are able to track what actions the end user took, how long the end user read it for, and if they deleted or forwarded the email. They claim they do this without JavaScript, and purely using embedded images. They claim that the method works across most major email clients.
What could they be doing to track this? Obviously, if they're doing it with third party applications that they don't control, whatever they are doing should be replicable.
I'm thinking that they realized that when an email client forwards or deletes an email, it 'opens' the email in a different way then normal, creating a unique user string on the server log of some kind? I'm grasping at strings, though.
http://litmusapp.com/email-analytics
Details here http://litmusapp.com/help/analytics/how-it-works
EDIT: It also looks like they track Prints. Maybe they do this by tracking calls to the 'print' css?
It's all done with good ol' image bugs. Breaking down how they find out...
Which client was used: Check the user-agent
Whether an email was forwarded: Done by attaching image bugs to divs that are loaded only when the message is forwarded.
Whether an email was printed: bug attached to print stylesheet
How long it takes to read an email: A connection that's kept open, as pointed out by Forrest (this is also how Facebook tracks(ed?) whether or not you are online on chat).
Whether an email was deleted: Check If a message was read for a short period of time or not opened. In fact, they group "glanced" and "deleted" together.
Of course none of this will work if email clients disable images in emails.
EDIT: Here's another question on this:
The OP actually has their tracking code, and this answer here explains how it works.
One way I can think of doing that is having an embedded image that loads from a script on a server. The script would not return anything or maybe send data really slowly to keep the connection open. Once the email is deleted the connection would be closed. This way they could know how long the email was open. Maybe they just assume if it's open for less than 10 seconds it was deleted?
Another way is tracking the referrer - this would give a lot of data on what a webmail client is doing, but I doubt it would be useful with a desktop client.
They know when the email is opened (it's when the image is called from their http server).
They also know what the user do and when since they can easily replace all links with their own tracking URLs redirecting to the original link.
There is nothing exceptional here. They are just a bit more advanced than their compatitors. There is no magic.
I have only one doubt: how they track delete. Technically, there is no way to know what happened to the message after it was read.
I suspect that a "deleted" mail is a mail that is never opened.