I try to use LodgingReservation Markup.
Documentation says that I can send email from own gmail mailbox to the same mailbox for testing.
I prepared simple test email:
<html>
<head>
</head>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "LodgingReservation",
"reservationNumber": "abc456",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "LodgingBusiness",
"name": "Hilton San Francisco Union Square",
"address": {
"#type": "PostalAddress",
"streetAddress": "333 O'Farrell St",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94102",
"addressCountry": "US"
},
"telephone": "415-771-1400"
},
"checkinDate": "2027-04-11T16:00:00-08:00",
"checkoutDate": "2027-04-13T11:00:00-08:00"
}
</script>
test
</body>
</html>
Email markup Tester can parse it successfully. But when I send the email and check it in my Inbox, it doesn't show card with reservation's information.
Origin message:
Return-Path: <kaba.nitesoft#gmail.com>
Received: from MSI ([90.189.151.28])
by smtp.gmail.com with ESMTPSA id q16-20020a2e84d0000000b0025e71cdb753sm287017ljh.46.2022.08.09.23.49.57
for <kaba.nitesoft#gmail.com>
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Tue, 09 Aug 2022 23:49:58 -0700 (PDT)
Message-ID: <62f35516.2e0a0220.3adbf.15f2#mx.google.com>
Date: Tue, 09 Aug 2022 23:49:58 -0700 (PDT)
X-Google-Original-Date: 10 Aug 2022 13:49:58 +0700
MIME-Version: 1.0
From: kaba.nitesoft#gmail.com
To: kaba.nitesoft#gmail.com
Subject: Confirmation
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
PGh0bWw+DQoJCQkJCQkJCTxoZWFkPiANCgkJCQkJCQkJPC9oZWFkPg0KCQkJCQkJCQk8
Ym9keT4NCgkJCQkJCQkJCQk8c2NyaXB0IHR5cGU9ImFwcGxpY2F0aW9uL2xkK2pzb24i
Pg0KCQkJCQkJCQkJCXsNCgkJCQkJCQkJCQkgICJAY29udGV4dC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QoJCQkJCQkJCQkJICB9LA0KCQkJCQkJCQkJCSAgImNoZWNraW5EYXRlIjog
IjIwMjctMDQtMTFUMTY6MDA6MDAtMDg6MDAiLA0KCQkJCQkJCQkJCSAgImNoZWNrb3V0
RGF0ZSI6ICIyMDI3LTA0LTEzVDExOjAwOjAwLTA4OjAwIg0KCQkJCQkJCQkJCX0NCgkJ
CQkJCQkJCQk8L3NjcmlwdD4NCgkJCQkJCQkJCXRlc3QNCgkJCQkJCQkJPC9ib2R5Pg0K
CQkJCQkJCTwvaHRtbD4=
What is wrong? How I can test markup correctly?
Another question:
If email contains attached receipt in pdf-format, Gmail shows reservation's card by parsed data from attached file. It's problem that Gmail parses it incorrectly (for instance it shows incorrect CheckoutDate). So, can I disable this behavior? Or how I can format pdf document that it will be parsed correctly?
Related
I'm tring my schema email.
The json-ld content is just copied from the google example.
I'm sending from my gmail address to my gmail address a custom HTML with json-ld script tag using SMTP connection.
The received email has a valid content, I have validated it using the schema validation tool (https://www.google.com/webmasters/markup-tester/u/0/), but the message in gmail is shown as a normal message without any special decoration.
What I'm missing?
This is the message:
Return-Path: <....#gmail.com>
Received: from .......
To: ....#gmail.com
From: .... <.....#gmail.com>
Subject: test
Message-ID: <.......#gmail.com>
Date: Wed, 14 Apr 2021 10:13:36 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="------------C711D6157D722F58A7A70245"
Content-Language: it
--------------C711D6157D722F58A7A70245
Content-Type: text/plain; charset=iso-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
test
--------------C711D6157D722F58A7A70245
Content-Type: text/html; charset=iso-8859-15
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body>
<p>test</p>
<p>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "Person",
"name": "John Doe",
"jobTitle": "Graduate research assistant",
"affiliation": "University of Dreams",
"additionalName": "Johnny",
"url": "http://www.example.com",
"address": {
"#type": "PostalAddress",
"streetAddress": "1234 Peach Drive",
"addressLocality": "Wonderland",
"addressRegion": "Georgia"
}
}
</script></p>
</body>
</html>
--------------C711D6157D722F58A7A70245--
I am trying to get MIME content from mail via Microsoft Graph.
It works fine for the emails received. But for sent mail, the MIME file is missing sentDateTime
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('9c934d23-5f49-4bdc-b1cc-8e5822d479bb')/messages/$entity",
"#odata.etag": "W/\"CQAAABYAAACBmUMmRgniS66W2x3+/Z4uAANecm6i\"",
"id": "AAMkADJjNThkZDIzLTM0M2MtNDBkNS1iNmNlLWEzMWEzYjMwY2M2NgBGAAAAAADQJQpK-gaHR5h_hbt1-C17BwCBmUMmRgniS66W2x3_-Z4uAAJUh6HiAACBmUMmRgniS66W2x3_-Z4uAANJ-s5hAAA=",
"createdDateTime": "2020-11-28T13:32:33Z",
"lastModifiedDateTime": "2020-11-28T13:33:17Z",
"changeKey": "CQAAABYAAACBmUMmRgniS66W2x3+/Z4uAANecm6i",
"categories": [
"NIRAS copy to: Passed"
],
"receivedDateTime": "2020-11-28T13:31:00Z",
"**sentDateTime**": "2020-11-28T13:31:45Z",
"hasAttachments": false,
MIME content: ...../messages/AAMkADJjNT...
From: "Reza Matin (REMA)" XXXX#niras.dk
To: Reza Matin yyyyy#gmail.com
Subject: MIME send mail test
Thread-Topic: MIME send mail test
Thread-Index: AdbFitC4fR/JJs5vSaCOp5gLqDx+jA==
Date: Sat,
28 Nov 2020 13: 31: 45 +0000
Message-ID:
AM9PR07MB71863080DD521AEA1FAF9C18A7F70#AM9PR07MB7186.eurprd07.prod.outlook.com
Keywords: NIRAS copy to: Passed
Content-Language: da-DK
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
Content-Type: multipart/alternative;
boundary="000_AM9PR07MB71863080DD521AEA1FAF9C18A7F70AM9PR07MB7186eurp"
MIME-Version: 1.0
--000_AM9PR07MB71863080DD521AEA1FAF9C18A7F70AM9PR07MB7186eurp
Content-Type: text/plain; charset="us-ascii"
Twilio API / TWIML
when a user responds to my text (via text) and i receive their answer to my end-point, how do i identify the sender?
at first i thought it would be the 'sid', but it is not.. I cannot find an 'conversation_id' that exists both in the 'sending' and the 'responding' that could alert my end-point who the sender is.
when i send a text from my server, the response looks like:
{ sid: 'MMf9...',
date_created: 'Thu, 18 Aug 2016 03:24:50 +0000',
date_updated: 'Thu, 18 Aug 2016 03:24:50 +0000',
date_sent: null,
account_sid: '...',
to: '...,
from: '...',
messaging_service_sid: '...',
body: 'Hi. this is an anonymous text from my server',
status: 'accepted',
num_segments: '1',
num_media: '1',
direction: 'outbound-api',
api_version: '2010-04-01',
price: null,
price_unit: null,
error_code: null,
error_message: null,
uri: '/2010-04-01/Accounts/...../Messages/......json',
subresource_uris: { media: '/2010-04-01/Accounts/...../Messages/...../Media.json' },
dateCreated: Thu Aug 18 2016 03:24:50 GMT+0000 (UTC),
dateUpdated: Thu Aug 18 2016 03:24:50 GMT+0000 (UTC),
dateSent: null,
accountSid: '....',
messagingServiceSid: '.....',
numSegments: '1',
numMedia: '1',
apiVersion: '2010-04-01',
priceUnit: null,
errorCode: null,
errorMessage: null,
subresourceUris: { media: '/2010-04-01/Accounts/..../Messages/..../Media.json' } }
When I respond with a text from my phone back to my server, my end-point receives...
{
"ToCountry": "US",
"ToState": "IL",
"SmsMessageSid": "SMe....",
"NumMedia": "0",
"ToCity": "Chicago",
"FromZip": "60626",
"SmsSid": "SMe....",
"FromState": "IL",
"SmsStatus": "received",
"FromCity": "CHICAGO",
"Body": "Try",
"FromCountry": "US",
"To": "....",
"MessagingServiceSid": "....",
"ToZip": "",
"NumSegments": "1",
"MessageSid": "SMe...",
"AccountSid": "...",
"From": "...",
"ApiVersion": "2010-04-01"
}
as you can see the sid in the original sms starts with MMf9... and all the ids in my phone's response start with SMe...
I was hoping for some conversation-id in the sending and responding would be there so that on my end-point, i could create a database entry for the conversation, and store the response of my user from the conversation. But now since there is no conversation_id between sender & receiver, I have no idea where to store the conversation and i have no idea who my server is sending responses to.
since i get the 'to' phone number in the twilio meta-data, that is a way to identify the user.
Since Twilio does let you add custom 'meta-data' to the text message the user would need to respond with extra text in the text message itself to identify the 'conversation', for example:
'John, do you think the winner should be: A, B or C? Add your voter-id to the response: 43z'
Then the user would need to text back: B 43z.
You end-point would identify the answer 'B', and '43z' would identify the respondent as 'John' (supposing you have a database look-up mapping John to 43z on your sever).
Then you can get a total count for who the winner should be, and also know each user's response for the conversation.
I'm a starter in Google Schema, I've followed the getting started, but it doesn't work... I've changed to another more simple json-ld, simple actions, but ....
I'm testing with a Django project, in my local, django smtp config to smpt.gmail.com. Same from and to email. I can see the email, but I can't see go-to-action....
This is my original mail:
Return-Path: <XX#gmail.com>
Received: from tomas-H55M-D2H (37.130.151.22.radiocable.net. [37.130.151.22])
by mx.google.com with ESMTPSA id n3sm2456222wix.1.2015.05.12.04.20.07
for <XX#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Tue, 12 May 2015 04:20:07 -0700 (PDT)
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
Subject: Testing
From: XX#gmail.com
To: XX#gmail.com
Date: Tue, 12 May 2015 11:20:07 -0000
Message-ID: <20150512112007.23123.78164#tomas-H55M-D2H>
Reply-To: XX#gmail.com
<html>
<head>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "Check this out",
"action": {
"#type": "ViewAction",
"url": "https://www.youtube.com/watch?v=eH8KwfdkSqU"
}
}
</script>
</head>
<body>
<p>
This a test for a Go-To action in Gmail.
</p>
</body>
</html>
I use rails Rails 3.2.3 and Resque to send an emails.
For some strange reason emails on production sended with empty body.
I try reproduce problem localy but with no luck.
production log does not have anything strange
Sent mail to somemail#rambler.ru (730ms)
Rendered user_mailer/_activation_email.html.erb (0.8ms)
Rendered user_mailer/activate_service_provider_with_email.html.erb within layouts/user_mailer (83.2ms)
Sent mail to somemail#rambler.ru (737ms)
Rendered user_mailer/_activation_email.html.erb (0.7ms)
Rendered user_mailer/activate_service_provider_with_email.html.erb within layouts/user_mailer (83.3ms)
Sent mail to somemail#rambler.ru (740ms)
Rendered user_mailer/discount.html.erb within layouts/user_mailer (231.6ms)
Sent mail to somemail#rambler.ru (536ms)
Starting the New Relic Agent.
Installed New Relic Browser Monitoring middleware
Creating scope :near. Overwriting existing method ServiceProvider.near.
Connected to NewRelic Service at collector-2.newrelic.com
Can anybody suggest what should I check - cache e.t.c to find problem ...
Email should contain html inside but I get plain text content type
Here is mail text:
Delivered-To: somemail#gmail.com
Received: by 11.11.66.777 with SMTP id c8csp32365iei;
Fri, 6 Jul 2012 06:34:44 -0700 (PDT)
Received: by 11.22.333.444 with SMTP id lv8mr2489460igc.41.1341581684021;
Fri, 06 Jul 2012 06:34:44 -0700 (PDT)
Return-Path: <noreply#oursite.ua>
Received: from soursite.ru (oursite.ru. [184.106.242.18])
by mx.google.com with ESMTPS id vb2si4216338igc.71.2012.07.06.06.34.43
(version=TLSv1/SSLv3 cipher=OTHER);
Fri, 06 Jul 2012 06:34:44 -0700 (PDT)
Received-SPF: pass (google.com: domain of noreply#oursite.ua designates 111.11.111.11 as permitted sender) client-ip=123.456.78.90;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of noreply#oursite.ua designates 123.456.78.908 as permitted sender) smtp.mail=noreply#oursite.ua
Received: from localhost ([127.0.0.1] helo=localhost.localdomain)
by oursite.ru with esmtp (Exim 4.71)
(envelope-from <noreply#oursite.ua>)
id 1Sn8k3-00086o-Vt
for somemail#gmail.com; Fri, 06 Jul 2012 13:38:40 +0000
Date: Fri, 06 Jul 2012 13:38:39 +0000
From: noreply#oursite.ua
To: somemail#gmail.com
Message-ID: <4ff6ea5fb7942_79c0f9c45069741#OURSITE.ru.mail>
Subject: =?UTF-8?Q?=D0=9C=D1=8B?=
=?UTF-8?Q?_=D0=BF=D1=80=D0=B8=D0=B2=D0=BE=D0=B4=D0=B8=D0=BC_=D0=BA?=
=?UTF-8?Q?_=D0=92=D0=B0=D0=BC?=
=?UTF-8?Q?_=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=BE=D0=B2_=D0=B8?=
=?UTF-8?Q?_=D0=BE=D0=BF=D0=BB=D0=B0=D1=87=D0=B8=D0=B2=D0=B0=D0=B5=D0=BC?=
=?UTF-8?Q?_=D0=B8=D0=BC_=D1=83=D1=81=D0=BB=D1=83=D0=B3=D0=B8?=
=?UTF-8?Q?_=D0=92=D0=B0=D1=88=D0=B5=D0=B3=D0=BE?=
=?UTF-8?Q?_=D1=81=D0=B0=D0=BB=D0=BE=D0=BD=D0=B0:?=
=?UTF-8?Q?_=D0=9F=D0=B0=D1=80=D1=82=D0=BD=D0=B5=D1=80=D1=81=D0=BA=D0=B0=D1=8F?=
=?UTF-8?Q?_=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B0?=
=?UTF-8?Q?_=D0=BE=D1=82?=
=?UTF- ?Q?_=D0=98=D0=BD=D1=82=D0=B5=D1=80=D0=BD=D0=B5=D1=82-=D0=BF=D0=BE=D1=80=D1=82=D0=B0=D0=BB= D0=B0?=
=?UTF-8?Q?=
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
And here is correct mail which I get on development
Return-Path: <noreply#oursite.ua>
Received: from [11.2.2.21] (HELO mx21.rambler.ru)
by mail43.rambler.ru (rmaild SMTP 1.3.41)
with ESMTP id 44865232 for someguy#rambler.ru; Fri, 06 Jul 2012 17:24:06 +0400
Received: from oursite.ru (oursite.ru [111.456.111.11])
by mx21.rambler.ru (Postfix) with ESMTP id E6D5ED85F69
for <someguy#rambler.ru>; Fri, 6 Jul 2012 17:24:05 +0400 (MSK)
Received: from localhost ([127.0.0.1] helo=localhost.localdomain)
by oursite.ru with esmtp (Exim 4.71)
(envelope-from <noreply#oursite.ua>)
id 1Sn8Zl-0007up-Cj
for someguy#rambler.ru; Fri, 06 Jul 2012 13:28:01 +0000
Date: Fri, 06 Jul 2012 13:28:01 +0000
From: noreply#oursite.ua
To: someguy#rambler.ru
Message-ID: <4ff6e7e127236_76d3127debc36876#oursite.ru.mail>
Subject: =?UTF-8?Q?=D0=90=D0=BA=D1=82=D0=B8=D0=B2=D0=B0=D1=86=D0=B8=D1=8F?=
=?UTF-8?Q?_=D0=B0=D0=BA=D0=BA=D0=B0=D1=83=D0=BD=D1=82=D0=B0_=D0=B2_oursite?=
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.o=
rg/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=3D"http://www.w3.org/1999/xhtml" xml:lang=3D"en-GB">
<head>
<title>oursite email notification</title>
<meta http-equiv=3D"Content-Type" content=3D"application/xhtml+xml; char=
set=3Dutf-8" />
<meta name=3D"description" content=3D"oursite!" />
<meta name=3D"keywords" content=3D"" />
<meta name=3D"robots" content=3D"index, follow" />
<meta http-equiv=3D"X-UA-Compatible" content=3D"IE=3Dedge" /> <!-- IE=
9 rounded corners -->
</head>
<body>
=
<div style=3D"border:4px solid #a90e15; width:600px; padding:20px; ba=
ckground-color:#fff; font-family:Helvetica, Arial, sans-serif;">
<div style=3D"color:#a90e15; font-size:60px; letter-spacing:-1px;=
font-weight:lighter;">Style <span style=3D"background-color:#a90e15; col=
or:#fff; font-size: 40px; padding:10px; font-weight:bold;">Up</span></div=
><br />
<div style=3D"color:#000; font-size:14px;">
=
=D0=94=D0=BE=D0=B1=D1=80=D0=BE =D0=BF=D0=BE=D0=B6=D0=B0=
=D0=BB=D0=BE=D0=B2=D0=B0=D1=82=D1=8C =D0=B2 oursite, DeleteThis!<br />
=D0=94=D0=BB=D1=8F =D1=82=D0=BE=D0=B3=D0=BE =D1=87=D1=82=D0=BE=D0=
=B1=D1=8B =D0=B0=D0=BA=D1=82=D0=B8=D0=B2=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D1=
=82=D1=8C =D0=92=D0=B0=D1=88 =D0=B0=D0=BA=D0=BA=D0=B0=D1=83=D0=BD=D1=82 =D0=
=BF=D1=80=D0=BE=D0=B9=D0=B4=D0=B8=D1=82=D0=B5 =D0=BF=D0=BE =D1=81=D1=81=D1=
=8B=D0=BB=D0=BA=D0=B5 <a href=3D"http://kiev.oursite.ua/activate/S6oqGyan=
66i83NoTNUI">http://kiev.oursite.ua/activate/S6oqGyan66i83NoTNUI</a>.<br =
/>
<br />
<br />
=
</div>
</div><!-- end of accom div -->
<div style=3D"color:#000; background-color:#FBF5E5; font-size:12px; w=
idth:628px; padding:10px; text-align:center; font-family:Helvetica, Arial=
, sans-serif;">
=D0=93=D1=80=D1=83=D0=BF=D0=BF=D0=B0 oursite! <a href=3D"http://v=
kontakte.ru/club1111409799" style=3D"color:#000; font-weight:bold;">=D0=B2=D0=
=BA=D0=BE=D0=BD=D1=82=D0=B0=D0=BA=D1=82=D0=B5</a><br />
=D0=93=D1=80=D1=83=D0=BF=D0=BF=D0=B0 =D0=B2 <a href=3D"http://www=
.facebook.com/oursite.ru" style=3D"color:#000; font-weight:bold;">faceboo=
k</a><br />
=D0=9D=D0=B0=D1=88=D0=B8 =D0=BD=D0=BE=D0=B2=D0=BE=D1=81=D1=82=D0=B8=
=D0=B2 <a href=3D"https://twitter.com/intent/user?screen_name=3Doursite_=
ru" style=3D"color:#000; font-weight:bold;">twitter</a><br />
<a href=3D"oursite.ua" style=3D"color:#000; font-weight:bold;"></=
a><br /><br />
© 2011 oursite! =
</div>
</body>
</html>
Looks like I find solution.
HTML template for mail contain only <%= render 'some_partial' %>
and nothing else
when I copy text from partial to template it begin render correctly.