Sendgrid open tracking event webhook not firing after the email is opened - email

I am trying to track email "open" event on Sendgrid. I have enabled Open tracking in Tracking setting in my Sendgrid account. I have also enabled Event webhook under Mail settings->Event Settings and I have enabled event webhook for all the events.
When I send the email, I get the event webhook response for "processed" and "delivered" events but if I open the emails I don't get any webhook response. I tried opening the email in Outlook and in Gmail in chrome browser.
Is there anything else to be done that I am missing? Please help.
Below is the response I get for processed and delivered mails.
[
{
"OrderId": "5555",
"email": "myemail#gmail.com",
"event": "processed",
"send_at": 0,
"sg_event_id": "cHJvY2Vzc2VkLTE3NTE3NjIzLV9PbGs1ZWx4U1VHUUZSTUk3aVBlY0EtMA",
"sg_message_id": "_Olk5elxSUGQFRMI7iPecA.filterdrecv-p3iad2-865cf6bb5-sddvl-18-5F560026-42.0",
"smtp-id": "<_Olk5elxSUGQFRMI7iPecA#ismtpd0002p1lon1.sendgrid.net>",
"timestamp": 1599471654
},
{
"OrderId": "5555",
"email": "myemail#gmail.com",
"event": "delivered",
"ip": "167.89.12.138",
"response": "250 2.0.0 OK 1599471656 r7si5783789ejy.514 - gsmtp",
"sg_event_id": "ZGVsaXZlcmVkLTAtMTc1MTc2MjMtX09sazVlbHhTVUdRRlJNSTdpUGVjQS0w",
"sg_message_id": "_Olk5elxSUGQFRMI7iPecA.filterdrecv-p3iad2-865cf6bb5-sddvl-18-5F560026-42.0",
"smtp-id": "<_Olk5elxSUGQFRMI7iPecA#ismtpd0002p1lon1.sendgrid.net>",
"timestamp": 1599471656,
"tls": 1
}
]

First of all, check the settings
Next, check your setting for engagement data
Finally, check your mail clients are allowed to download images and have any extensions block ads or not
Sendgrid will add a transparent 1-pixel image at the bottom of email, if with any reason cannot load this picture, you won't receive opened event

I had the same problem, you need to go to settings-> tracking and make sure open and click events are enabled.

Related

Using DirectLine v3, how do you send a message to the USER?

I'm implementing a DirectLine client for connecting WhatsApp via Twilio and the BotFramework. I've been able to:
Create conversations
Listen to the conversation's websocket
Send activities to the bot
For the life of me I cannot figure out how I can send an activity to the DirectLine client, so it can forward it to the user. In other words, how can I get some activity to pop-up on the DL client's websocket?
On the bot side, what I'm doing is:
Ask the client to create a conversation in DirectLine between the bot and the user (I'm using phone numbers as recipient/from IDs)
Use the new conversation and its serviceUrl to post an activity from the bot to the user
I've tried a bunch of different auth tokens to do this, the closest I've gotten was using the conversation's DirectLine token as a bearer auth:
POST https://directline.botframework.com/v3/directline/conversations/CONVERSATION_ID/activities
{
"type": "message",
"text": "message",
"from": { "id": "whatsapp:BOT_PHONE_NUMBER" },
"recipient": { "id": "whatsapp:USER_PHONE_NUMBER" }
}
Which results in this activity popping up in the websocket:
{
"channelId": "directline",
"conversation": {"id": "CONVERSATION_ID"},
"from": {"id": "whatsapp:BOT_PHONE_NUMBER"},
"id": "CONVERSATION_ID|0000006",
"recipient": {
"id": "BOT_ID#something",
"name": "Bot"
},
"serviceUrl": "https://directline.botframework.com/",
"text": "pls",
"timestamp": "2019-08-26T23:14:13.3099739Z",
"type": "message"
}
Which is obviously useless because the user's phone number is missing?! Instead the "recipient" was overwritten to the bot's.
My question is: What exactly is the canonical way to achieve this?
I can just bypass the BF altogether, call my client and have it send a message to the user. This means, however, that the implementation for this channel is different from all others. If this is the way to go, what's the point of the websockets then?

Trigger Botframework v4 on Facebook Messenger from an external website call

i am trying to open a specific messenger page and trigger a dialog to display carousels based on the parameters that my users entered on my website.
i am leveraging the m.me link to open my messenger page (where my botframeowrk bot is deployed). After opening the page I am not able to invoke a dialog.
How can I achieve this ???
I went through the Ms Botframework V4 docs and didn't find any mention of channel specific trigger.I want to pass 4 parameters to my Bot from the website and then further make an api call in the dialog that i will invoke to display results.
Thanks in Advance.
You need to enable Messaging Referrals in the Facebook Developer portal to use m.me links. In the portal, click on the settings blade on the left, scroll down to webhooks, and click edit events. A window should pop up where you can enable messaging_referrals.
Facebook only lets you add the ref parameter to the m.me link, so to send additional data to the bot using this link, you will have to encode the values in the ref parameter and parse the data on the bot side - I would recommend using a separator value like a comma or a slash to organize your data.
https://m.me/<PAGE_NAME>?ref=my,additional,data
The event will be send to the bot as a message activity with a referral attribute where you can grab your data.
m.me link bot activity
{
"type": "message",
"id": "CDbQi3u62J7",
"timestamp": "2019-03-19T19:30:11.219Z",
"serviceUrl": "https://facebook.botframework.com/",
"channelId": "facebook",
"from": {
"id": "2031650190235097",
"name": "TJ Durnford"
},
"conversation": {
"isGroup": false,
"id": "2031650190235097-218838049015546"
},
"recipient": {
"id": "218838049015546",
"name": "thdurn-all-channels"
},
"channelData": {
"sender": {
"id": "2031650190235097"
},
"recipient": {
"id": "218838049015546"
},
"timestamp": 1553023811219,
"referral": {
"ref": "my,additional,data",
"source": "SHORTLINK",
"type": "OPEN_THREAD"
}
}
Hope this helps!

Skype Bot sending message (not a reply)

Trying to create a Skype Bot, but I have a problem. Please, help me.
I use PHP so I use REST (not NodeJS or C# SDK).
The task: I have to send data from html form on my website to Skype (so I don’t have to reply to a message, but just send).
Well, I have successfully create a bot in Microsoft Bot Framework.
Then I have successfully received an access_token.
Then they say in docs that I have to send a POST to:
/v3/conversations/{conversationId}/activities
According to https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-send-and-receive-messages I have to send a request to /v3/conversations with JSON like that:
{
"bot": {
"id": "12345678",
"name": "bot's name"
},
"isGroup": false,
"members": [
{
"id": "1234abcd",
"name": "recipient's name"
}
],
"topicName": "News Alert"
}
But what is the "member's id and member's name"?
To get the member ids of some members, add all those members in a group and add the bot, too, to the group and preferably send a message in the group, mentioning the bot. You will receive a json with a conversationId. With this conversationId, make a get request to v3/conversations/{conversationId}/members in order to receive the member-ids and member-names of the members in the group.
You can now proceed with these member-ids and member-names to start individual conversations with the members (which is illustrated in my answer to this question).

How to get the text of message, when quick reply is tapped in facebook messanger bot?

Question related to API.AI Bot , Facebook Messanger
When a Quick Reply is tapped, a text message will be sent to your webhook Message Received Callback. The text of the message will correspond to the title of the Quick Reply, when the content type is 'text'. How can we get the text of message! when the content type is 'location'?. It is mentioned that when we use location quick reply, we don't add title field. so how can we get a text message without using title?
I am unable to call webhook, due to not getting text of the message.
Please help me out. I am stuck from last 2 days.
You can manipulate with ChannelData.
hehe I got your Problem
I hope you know the responses coming from webhook if not here is sample responses
responses for quick_reply with type text
"message": {
"quick_reply": {
"payload": "productId-12345678"
},
"mid": "mid.$cAAFXVKjn1KtjtBAtHFdgsrkbGWwm",
"seq": 15453,
"text": "buy this"
}
responses for quick_reply with type location
"message": {
"mid": "mid.$cAAFXVLGKMJ1jtApB51dgsTnITNet",
"seq": 25413,
"attachments": [
{
"title": "Hi-tech city Hyderabad",
"url": "https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.bing.com%2Fmaps%2Fdefault.aspx%3Fv%3D2%26pc%3DFACEBK%26mid%3D8100%26where1%3DHyderabad%2B500081%26FORM%3DFBKPL1%26mkt%3Den-US&h=ATPXrPSDsyApPyqD9ozWt82dL9M28VZPQCqmICpsmBfXY0BCffiP4ychQ36sSWUNNBOeiJZq8tq8DLF7-A0_7VViPwwC64LM1XR-uAUN0sXdcgP5rDg&s=1&enc=AZPs1nCI5B8J4s27b7zAJKJDYaa2KSlhxQ5ppN30fb5lI3KUFcnQlSn_g4796j3p4ShwnzPvRyqXS470lEluzN06",
"type": "location",
"payload": {
"coordinates": {
"lat": 17.44521051,
"long": 78.38363399
}
}
}
]
}
as you can see that in text type quick_reply we are getting the previous context as text to which user respond and we can use respective payload for processing. This is what facebook try to incorporate context of chat for a single time for quick reply they havnt incorporated this to other may be because of frequent use of context in case of text quick_reply rather than location.
Now the things which you are wondering about is context . Yes you need to maintain context of chat and thats how a real bot thing came into picture. you can maintain context of chat using many free nlp engine like wit.ai , api.ai and other

setting event organizer with Outlook Calendar REST API

I am using the Outlook REST API for creating events and sending its invitations, based on this documentation
I authenticate the logged in user, and send its Bearer token through the Authorization header of the request, and the json-formatted event on its content.
If I set the "Organizer" to another user rather than the authenticated one, as well as the "IsOrganizer" property to "false", it gets totally ignored and sets the current logged in user as the organizer.
Any clues of what could be happening?
Is there another way of doing this?
Thank you!
I'm posting this in case someone else finds and needs an answer for this scenario...
You (Account A) can create a calendar event as someone else (Account B) through Office365 REST APIs as long as the account has permission to send as the other user account.
Here are the steps:
1) Call the Office365 REST API as follows,where {{{user2email}}} is the user you want the event to be created as (Account B's email address):
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendar
This should return Account B's user's calendar ID.
2) Pass in your JSON - the following is an example of what I used during unit testing:
{
"Subject": "Test - Created using Office365 Calendar REST API should be from Technology Notice",
"IsOrganizer": "False",
"Body": {
"ContentType": "HTML",
"Content": "This is where body copy goes HTML supported"
},
"Start": "2015-12-11T19:00:00Z",
"End": "2015-12-11T20:00:00Z",
"Attendees": [
{
"EmailAddress": {
"Address": "attendee1#yourcompany.com",
"Name": "Attendee One"
},
"Type": "Required"
}
],
"Organizer": {
"EmailAddress": {
"Address": "tnotice#yourcompany.com",
"Name": "Technology Notice"
}
}
}
'Technology Notice' will be who the calendar invite is from.
3) Use the ID from step 2 in your POST request, for example:
https://outlook.office365.com/api/v1.0/users/{{{user2email}}}/calendars/{{{ID}}}/events
Note: Make sure you're sending the POST request as the authenticated user account (Account A) who's account the mailbox/calendar it actually belongs to.
If everything is right you should be able to send a calendar invite and have it show up as originating from Account B instead of Account A.
Hope this helps someone out.
This is the correct behavior. You cannot create an event on User A's calendar but set the organizer to User B.