Gmail Markup for Multiple Events - gmail

I'm developing event markup using json-ld to be included with confirmation emails.
Some of my events are recurring at regular intervals. However, recurring events are not supported by the latest Schema.org specifications so I've followed the advice offered here: http://lists.w3.org/Archives/Public/public-vocabs/2011Dec/0062.html and decided to embed a json list of the individual events.
The json-ld passes the tests in the Email Markup Tester provided by google (https://www.google.com/webmasters/markup-tester/u/0/).
However, when I test the google calendar integration by sending the email to myself, only 1 out of 6 events in the series appears in my calendar (oddly, it's neither the first or last event in the list).
Does gmail markup support multiple events in the same email? If so is there a better way to do it?
Example Markup:
<script type="application/ld+json">
[
{
"reservationNumber": "7e15afb6b2485005e55481be58de4141b70f85006bd25823",
"reservationFor": {
"startDate": "2015-05-09T16:00:00-07:00",
"endDate": "2015-05-09T22:30:00-07:00",
"description": "regularly schedule XXXX",
"location": {
"address": {
"addressCountry": "US",
"addressLocality": "XXX",
"addressRegion": "XXX",
"streetAddress": "XXX",
"postalCode": "XXX",
"#type": "PostalAddress"
},
"#type": "Place",
"name": "XXX"
},
"#type": "Event",
"name": "XXX Every 2 Weeks"
},
"modifyReservationUrl": "https://example.com/XXX",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "XXX"
},
"#context": "http://schema.org",
"#type": "EventReservation"
},
...
{
"reservationNumber": "40553edbce52f0052e153919a4dad49ec32516c15433bf4a",
"reservationFor": {
"startDate": "2015-05-23T16:00:00-07:00",
"endDate": "2015-05-23T22:30:00-07:00",
"description": "regularly schedule XXX",
"location": {
"address": {
"addressCountry": "US",
"addressLocality": "XXX",
"addressRegion": "XXX",
"streetAddress": "XXX",
"postalCode": "XXX",
"#type": "PostalAddress"
},
"#type": "Place",
"name": "XXX"
},
"#type": "Event",
"name": "XXX Every 2 Weeks"
},
"modifyReservationUrl": "https://example.com/XXX",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "XXX"
},
"#context": "http://schema.org",
"#type": "EventReservation"
},
]
</script>

You can try adding this markup in the html file by using the Quick Apps script tutorial mentioned in the documentation here.

Does making a list help: https://schema.org/ItemList
Haven't tested this out, but it might be a useful approach.

Related

MS Teams Botframework - getting the "from.name" field

I have a bot running from a desktop <> ngrok <> azure <> MS Teams as a webchat. It is written in Python. Is there a way I can read the field from.name via Botframework/Python (the string USERNAME in the example below)?
The documentation says to use recipient.name, but my recipient.name is the bot's name as it is being run as a webchat (not installed in MS Teams).
I see the following POST API info via ngrok.
{ "text": "hello...",
"textFormat": "plain",
"type": "message",
"timestamp": "2022-09-25T05:26:29.629655Z",
"localTimestamp": "2022-09-25T13:26:29.629655+08:00",
"id": "XXXXXX",
"channelId": "msteams",
"serviceUrl": "https://smba.trafficmanager.net/XXXX",
"from": { "id": "XXXXX", "name": "USERNAME", "aadObjectId": "XXXX" },
"conversation": { "conversationType": "personal", "tenantId": "XXXX", "id": "XXXXXX" },
"recipient": { "id": "XXXXXXX", "name": "BOTNAME" },
"entities": [ { "locale": "en-US", "country": "XX", "platform": "iOS", "timezone": "XX/XX", "type": "clientInfo" } ], "channelData": {"tenant": {"id": "XXXXXX"}},"locale": "en-US","localTimezone": "XX/XX"}
If you want to read the field from.name via Botframework/Python.You can use the below code-
name = turn_context.activity.from_property.name
await turn_context.send_activity(
f"It is a good practice to welcome the user and provide personal greeting. For example: Welcome {name}"
)
Reference Sample-https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/python/03.welcome-user/bots/welcome_user_bot.py#L100

Message card posting to target returns blank from teams input

I am trying to get some information from user via cards, the target url is receiving a blank post request instead of user input.Here is the code
requests.post(url="incoming webhook",
json=
{
"#type": "MessageCard",
"#context": "http://schema.org/extensions",
"summary": "John Doe",
"title": "input",
"potentialAction": [
{
"#type": "ActionCard",
"name": "Change status",
"inputs": [{
"#type": "MultichoiceInput",
"id": "list",
"title": "Select a status",
"isMultiSelect": "true",
"style":"compact",
"choices": [{
"display": "OBE",
"value": "OBE"
}, {
"display": "OUI",
"value": "OUI"
}, ]
}],
"actions": [{
"#type": "HttpPOST",
"name": "Save",
"target": "aworkingurl",
}]
}]})
The url that I used is from a site called webhooks.site which gives urls that accept POST and GET requests, the site shows that a POST has been attempted but the content is empty but when I posted some string to the same url it show that data just fine.

Structured data for company with two (or more) branches

I'm trying to figure out how to implement structured data for my company with 2 branches. The branches are in the same city, but there is not head offfice or a difference in hierarchy. The branches do not have their own landing page on the website. It's a dentist office so I wanted to use LocalBusiness -> Dentist.
Because I found that nesting the data was better then to separate the data, I thought of using #brancheOf or #subOrganization. However when I try this the testing tool tells me these properties do not work with #type 'Dentist'. Can somebody give me some advise on how to continue? This is what I had so far:
<script type='application/ld+json'>
{
"#context": "http://www.schema.org",
"#type": "Dentist",
"name": "",
"url": "",
"sameAs": [
""
],
"logo": "",
"image": "",
"description": "",
"address": {
"#type": "PostalAddress",
"streetAddress": "",
"addressLocality": "",
"addressRegion": "",
"postalCode": "",
"addressCountry": ""
},
"geo": {
"#type": "",
"latitude": "",
"longitude": ""
},
"hasMap": "",
"openingHours": "Mo 09:00-17:30 Tu 08:30-17:30 We, Th, Fr 08:00-17:30",
"contactPoint": {
"#type": "",
"contactType": "",
"telephone": "",
"email": ""
},
"#subarganization": "http://www.schema.org",
"#type": "Dentist" (I didn't continue here because I got the error, but I would enter address details etc. from the second branch).
}
</script>

Gmail EventReservation markup disappearing

My EventReservation markup has been approved by Google but I'm noticing that at times, the ViewAction (a simple link) that I associated with it disappears from Gmail and I was wondering what could cause this problem.
Markup example:
{
{
"#context":"http://schema.org",
"#type":"EventReservation",
"reservationStatus":"http://schema.org/Confirmed",
"reservationNumber":XXX,
"url":"XXX",
"action": {
"#type":"ViewAction",
"name":"Message Host",
"url":"XXX"
},
"modifiedTime":"2015-08-13T17:56:29+0000",
"underName": {
"#type":"Person",
"name":"XXX"
},
"reservationFor": {
"#type":"Event",
"name":"XXX",
"image":"XXX",
"startDate":"2015-08-17T10:42:28-0400",
"endDate":"",
"location": {
"#type":"Place",
"name":"",
"address": {
"streetAddress":"XXX",
"addressLocality":"XXX",
"addressRegion":"XXX",
"postalCode":"XXX",
"addressCountry":"XXX"
}
}
}
}
There are a few ways to generate a button with the EventReservation schema. You can generate a "View Ticket" button using a URL property:
"url": "https://example.com"
To get a "modify reservation" button, use the modifyReservation property:
"modifyReservationUrl": "https://example.com
In the example you've posted, I'm assuming you're trying to trigger a custom action label with the ViewAction schema. I was able to achieve this by defining a top level Event Reservation first then the View Action. My example below:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "123456",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "Event",
"name": "Example Event",
"startDate": "2015-08-17T14:30:00-08:00",
"location": {
"#type": "Place",
"name": "AT&T Park",
"address": {
"#type": "PostalAddress",
"streetAddress": "24 Willie Mays Plaza",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94107",
"addressCountry": "US"
}
}
},
"potentialAction": {
"#type": "ViewAction",
"name": "View Event",
"target": "https://www.example.com"
}
}
</script>
The action button doesn't disappear and should stay:
json+ld markup is also removed by some eMail carriers.
I found Mandrill was removing my markup, until I changed the format from json+ld to microdata.

Docu Sign Rest API Sender View Issue for in Process Envelope

We are trying to use embedded signing to display the sender view in iframe.
If an envelope has 2 signers and one of them have signed the envelope we want to display the current state of the envelope to the sender.
Is there any API available to display current state of envelope to the sender.
Per the comment that you've added to your answer, the simplest way to retreive current status of all recipients for an Envelope is the GET Recipients API call:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/recipients?include_tabs=false&include_extended=false
The response will contain an array of recipient objects for each recipient type, and each recipient object has a status property that indicates the current status of the recipient. For example, here's a response for an Envelope that contains 2 Signers -- the first has Completed signing, the second has not (status=delivered):
{
"signers": [
{
"signInEachLocation": "false",
"name": "Abby Adams",
"email": "abby#outlook.com",
"recipientId": "04cdba57-5383-4917-9081-e9dad16ba8a9",
"recipientIdGuid": "04cdba57-5383-4917-9081-e9dad16ba8a9",
"requireIdLookup": "false",
"userId": "1860fbdc-96ee-4d14-8353-c0213cd2728f",
"routingOrder": "1",
"roleName": "Signer 1",
"status": "completed",
"signedDateTime": "2014-04-24T14:00:10.5800000Z",
"deliveredDateTime": "2014-04-24T13:59:35.2330000Z",
"templateLocked": "false",
"templateRequired": "false"
},
{
"signInEachLocation": "false",
"name": "Adam Smith",
"email": "adam#outlook.com",
"recipientId": "fb3708f5-552f-410e-8029-9abbb5214196",
"recipientIdGuid": "fb3708f5-552f-410e-8029-9abbb5214196",
"requireIdLookup": "false",
"userId": "ecd6f430-5c08-4a4c-876e-ba7ad95f13dc",
"routingOrder": "2",
"status": "delivered",
"deliveredDateTime": "2014-04-24T14:00:28.1930000Z"
}
],
"agents": [],
"editors": [],
"intermediaries": [],
"carbonCopies": [],
"certifiedDeliveries": [],
"inPersonSigners": [],
"recipientCount": "2",
"currentRoutingOrder": "2"
}
If you need more detailed audit trail information, you can use the GET Audit Events API call:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/audit_events
The Response to this request will contain an array of auditEvent objects. Each auditEvent object is composed of a single property -- eventFields -- which is an array of name/value pairs.
For example, the following response shows that Mary Smith created the envelope and sent the envelope, and then John Doe viewed the envelope and declined the envelope:
{
"auditEvents": [
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:07:52.7741974Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Mary Smith"
},
{
"name": "UserId",
"value": "bc266e97-83a6-472c-XXXX-ebad10e4cc6a"
},
{
"name": "Action",
"value": "Registered"
},
{
"name": "Message",
"value": "The envelope was created by Mary Smith"
},
{
"name": "EnvelopeStatus",
"value": "created"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": ""
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
},
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:07:53.6321919Z"
},
{
"name": "Source",
"value": "api"
},
{
"name": "UserName",
"value": "Mary Smith"
},
{
"name": "UserId",
"value": "bc266e97-83a6-472c-a25b-ebad10e4cc6a"
},
{
"name": "Action",
"value": "Sent Invitations"
},
{
"name": "Message",
"value": "Mary Smith sent an invitation to John Doe [john#outlook.com]"
},
{
"name": "EnvelopeStatus",
"value": "sent"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": "John Doe [john#outlook.com]"
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
},
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:12:17.9412976Z"
},
{
"name": "Source",
"value": "web"
},
{
"name": "UserName",
"value": "John Doe"
},
{
"name": "UserId",
"value": "03c8a856-c0ae-41bf-943d-ac6e92db66a8"
},
{
"name": "Action",
"value": "Viewed"
},
{
"name": "Message",
"value": "John Doe viewed the envelope [documents:(Mutual NDA with anchors.pdf)]"
},
{
"name": "EnvelopeStatus",
"value": "sent"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": "John Doe viewed the envelope [documents:(Mutual NDA with anchors.pdf)]"
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
},
{
"eventFields": [
{
"name": "logTime",
"value": "2014-05-23T03:12:30.3432181Z"
},
{
"name": "Source",
"value": "web"
},
{
"name": "UserName",
"value": "John Doe"
},
{
"name": "UserId",
"value": "03c8a856-c0ae-41bf-943d-ac6e92db66a8"
},
{
"name": "Action",
"value": "Declined"
},
{
"name": "Message",
"value": "John Doe declined the envelope [Reason: I changed my mind.]"
},
{
"name": "EnvelopeStatus",
"value": "declined"
},
{
"name": "ClientIPAddress",
"value": "XX.XX.XX.XXX"
},
{
"name": "Information",
"value": "Reason: I changed my mind."
},
{
"name": "GeoLocation",
"value": ""
},
{
"name": "Language",
"value": "english (us)"
}
]
}
]
}
The DocuSign REST API Guide (https://10226ec94e53f4ca538f-0035e62ac0d194a46695a3b225d72cc8.ssl.cf2.rackcdn.com/rest-api-guide-v2.pdf) contains information about both of the API calls.
--- UPDATE ---
You can retrieve an Envelope's document(s) at any time (i.e., regardless of signer/envelope status) by using the "GET Envelope Documents" API request:
GET https://{{env}}.docusign.net/restapi/{{version}}/accounts/{{acctId}}/envelopes/{{envelopeId}}/documents/combined
The response will contain a byte stream that represents the contents of the Envelope document(s) in PDF format -- your application can then simply write that byte stream to the browser to display the document(s). See page 177 of the REST API Guide for details about this operation.
Regarding your question about customizing the "Embedded Sender View" -- it's not possible to customize the Sender view via the API -- i.e., an 'embedded Sender will always have the ability to do everything that they'd be able to do if sending directly via the DocuSign web console.
Once a DocuSign envelope is in progress (meaning it has been sent and is NOT in draft state) then you can not generate the sender view. The sender view is used to tag the envelope, and if the envelope has already been sent then no more tagging is allowed.
So to answer your question, no it's not possible to generate a sender view on a sent envelope, it's only possible to generate a signing URL at that point, and you can only generate the signing URL for recipients who have their clientUserId property set.
More on Embedded Signing here:
https://www.docusign.com/developer-center/explore/features/embedding-docusign

Resources