Identify email message related to received webhook - email

Today I started to learn about webhooks and I was wondering if it is possible to know exactly what message is related to a received webhook.
For example, I have a website where customers can register and, after a successful registration, I'm sending them a confirmation via email. Is it possible to know that the customer clicked on that specific email message? (Considering that the customer can receive other types of email messages like password recovery, newsletters, etc). I know I can use the subject (something like if subject == 'Welcome to My Site' then do-email-post-registration-clicked-routine) but if the subject changes, or if they change it (when we reply to a message, usually the email client prepends "Re:" to the subject, I won't be able to track it.
Thanks in advance!

Yes. You can use custom arguments to track individual emails. Custom arguments get sent with event webhooks.
More documentation can be found here: https://sendgrid.com/docs/API_Reference/SMTP_API/unique_arguments.html

Related

Automatically triggering an action on your backend from an incoming email message

Platforms like upwork have a feature where when you get a message through those platforms, you also get an email.
Instead of logging Upwork to reply, the user can simply reply to the incoming email, and the message is then automatically sent by upworks backend to the original person who sent the message.
How exactly is this done in a way that Upwork knows the inbox to send the message to, and is able to receive a message via email.
It seems Upwork handles incoming emails by detecting any project ID in the email message - it can be an ID in the subject or in the email body and etc. So, the email can be recognized easily and processed. Also additional information can be checked on the incoming email - the sender (whom the original emails was sent out), the recipient and etc. Actually, it is up to your needs how algorithm should be working.

How do email threads/chains work, and how do I ensure sending two emails separately will be merged together in a thread in the users email client?

I'm using AWS SES to send emails to customers. I want to send an initial email to confirm an action they've made on my website, and then send subsequent emails to that same email address to notify of any subsequent activity on that initial action.
Different email clients appear to implement this behaviour differently, and I've read about the thread-index header here, but that doesn't cover all clients.
Is there a standard way to mark that an email belongs to the thread of a previously sent email?
Thanks
When adding the References Header to Emails, you can add message-ids of previously sent emails in order to create email threads.
Of course it's again a topic of the client to fulfill this feature, but it should be supported by major email clients.
Heres an old blogpost about that. (considering that email is also old, it should be fine ;) )
https://wesmorgan.blogspot.com/2012/07/understanding-email-headers-part-ii.html

How to track status of email in sendgrid without using SMTP.

I want to send emails which contain different contents to same user and I need to track their status. Are there any way to do that without using SMTP.
Sounds like you want Unique Args. These are called custom_args in the v3 API mail send argument, but it's the same concept.
Once you activate the Event Webhook, all events will include the appropriate unique_args, so you can relate each specific message to each.
Also, whenever you send a message to SendGrid, the acceptange response includes a message_id, which will be in all those events.

Tracking email responses

What is the best way of tracking responses for email campaigns? I was thinking on adding something to the reply-to field of the email (for example luqita+campaigns#stackoverflow.com), but I'm not sure if there is something more neat that could avoid this?
I thought about headers too, but it's important to note that the address luqita#stackoverflow.com would send many different campaigns, and the 'in-reply-to' header info would not be useful then to differentiate (while using luqita+campaign1 or luqita+campaign2 could)
What can I do?
So you want to be able to execute some logic when someone replies to an email you have sent through SendGrid? If you have access to change the MX record of the domain of the email address at which you want to receive the replies, you could use SG's Parse API to get a POST request to a script whenever email is receive at the address.
I think you would indeed have to set a magic reply-to address for each campaign. This seems like a perfectly fine solution; it's also how SG itself tracks bounces - it sets the return-path to something like bounces+{attempted-recipient-email}#sendgrid.com. Then examine the 'to' parameter of the POST notification you receive to know which campaign the reply is associated with.
When you say "tracking responses", do you mean that you expect users will reply to the Email, or do you mean that they'll click on a link in the Email and interact with a web site?
SendGrid obviously offers click tracking and open tracking, and you can set up to 10 different categories for tracking campaign stats and see delivery/bounces/opens/clicks/etc based on those categories. They also have a Google Analytics plugin that can feed back some analytics data to Google. And as #LinusR mentioned in his answer, the SendGrid Parse API can be set up in a way that reply Emails can get parsed and posted back to your site.
If the user will be interacting with your web site, you can use the "unique args" setup at SendGrid to set a unique string/hash to append to any URLs that can help identify a particular user, campaign, or whatever else you want to track.

MFMessageComposer iPhone,Auto Message Send

Any one know how to implement auto send message using MFMessageComposer....i mean No need of displaying The message Composer..we Have to sent the pre-defined message to a given Number..Or any other way without using MFMessageComposer..???
You can't auto-send messages with MFMessageComposer. It always displays the message to the user before sending (and rightly so).
An alternative would be to call a webservice which dispatches an email to you. Or put enough SMTP code in your app to get emails sending. You'll need your own email system for this though as you'll not be able to get the users email settings.