I'm trying to test a gmail "Go-To Action" in an email. I followed the instructions to send the email over SMTP to myself, so that it's from and to the same address, but the action isn't showing up. Google's email validator says the email is fine. What am I doing wrong?
Return-Path: <workspace#example.com>
Received: from gmail.com (c-24-5-42-195.hsd1.ca.comcast.net. [24.5.42.195])
by mx.google.com with ESMTPSA id zq5sm15392663pbb.37.2014.08.03.15.47.32
for <workspace#example.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Sun, 03 Aug 2014 15:47:32 -0700 (PDT)
Message-ID: <53debc04.c5a7440a.7465.5fae#mx.google.com>
X-Google-Original-Message-ID: ws-5.example.com
Return-Path: <no-reply#example.com>
Date: Sun, 03 Aug 2014 15:47:31 -0700
From: 'Admin' <workspace#example.com>
Reply-To: 'Admin' <workspace#example.com>
To: workspace#example.com
Subject: New message in testing
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_53debc035aaca_16dc93fed86033be07762b";
charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Example-Post: 5
----==_mimepart_53debc035aaca_16dc93fed86033be07762b
Date: Sun, 03 Aug 2014 15:47:31 -0700
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <53debc037b851_16dc93fed86033be077729#Andrews-MacBook-Air.local.mail>
THIS IS THE TEXT VERSION, skipped for this example.
----==_mimepart_53debc035aaca_16dc93fed86033be07762b
Date: Sun, 03 Aug 2014 15:47:31 -0700
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-ID: <53debc037f5be_16dc93fed86033be0778f3#Andrews-MacBook-Air.local.mail>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<style type="text/css">
body {
color: #333;
font-family: Helvetica, Arial, sans-serif;
}
h2, h3, h4 {
font-weight: normal;
}
a {
color: #5572BC;
font-weight: bold;
}
p {
margin-bottom: 18px;
}
</style>
</head>
<body style="font-family: Arial, Helvetica, sans-serif; background-color: white;">
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EmailMessage",
"description": "View your Project",
"action": {
"#type": "ViewAction",
"url": "http://example.com/",
"name": "View Project"
},
"publisher": {
"#type": "Organization",
"name": "Example",
"url": "https://example.com"
}
}
</script>
<div style='margin-left: 10px;'>
<div style='font-weight: bold;'>
New message in your Example.com Project
</div>
<p>Again again?</p>
</div>
</body>
</html>
----==_mimepart_53debc035aaca_16dc93fed86033be07762b--
Related
I have an email template that contains a var - ${token} for a temporary password. In this case, token == #.iJ<ep2C]a-d$}4xK{. When rendered in Gmail token is truncated at the < character and rendered as #.iJ. How can I escape chars in token so they render correctly in Gmail?
Template
From: info#mycompany.com
Subject: New User Activation
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="alternative_boundary"
This is a message with multiple parts in MIME format.
--alternative_boundary
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Dear ${firstName} ${lastName},
Please click on the below link and use Temporary password: ${token} to activate your new account.
${reset_url}
--alternative_boundary
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>New account activation</title>
</head>
<body>
<p>Dear ${firstName} ${lastName},</p>
<p>Please click here to activate your new account and use verification code: ${token} in the page</p>
</body>
</html>
You'll want to escape the reserved characters per the MDN docs:
& &
< <
> >
" "
Gmail thinks the < is the start of an HTML tag.
Assuming you're using JavaScript replace these in the token like Fastest method to escape HTML tags as HTML entities?:
function escapeHtmlEntities(str) {
return str
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"');
}
In your template:
...${escapeHtmlEntities(token)}...
Can anyone help me in figuring out how can I extract body from the headers section in the following response using bash scripting.
I have tried awk, sed, grep ... by looking some of the existing solutions here on SO, but with little success.
Let me know if I need to provide any additional info.
HTTP/1.1 200 OK
Cache-Control: max-age=604800
Content-Type: text/html
Date: Mon, 24 Jul 2017 10:16:19 GMT
Etag: "359670651+gzip+ident"
Expires: Mon, 31 Jul 2017 10:16:19 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (iad/182A)
Vary: Accept-Encoding
X-Cache: HIT
Content-Length: 1270
<!doctype html>
<html>
<head>
<title>Example Domain</title>
<meta charset="utf-8" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body {
background-color: #f0f0f2;
margin: 0;
padding: 0;
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
div {
width: 600px;
margin: 5em auto;
padding: 50px;
background-color: #fff;
border-radius: 1em;
}
a:link, a:visited {
color: #38488f;
text-decoration: none;
}
#media (max-width: 700px) {
body {
background-color: #fff;
}
div {
width: auto;
margin: 0 auto;
border-radius: 0;
padding: 1em;
}
}
</style>
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is established to be used for illustrative examples in documents. You may use this
domain in examples without prior coordination or asking for permission.</p>
<p>More information...</p>
</div>
</body>
</html>
I didn't explain correctly, what I meant is to extract the body from http response and not body of the html response. In other words, how can extract http's body response in general (the part in the response after \r\n\r\n), this code is just for demo purposes...
sed -n '/<body>/,/<\/body>/p' filename
Print everything from to
To output the body inner HTML(without the body tag):
sed -n '/<body/,/<\/body>/{//!p}' file
I test all the examples with this mail sender: https://putsmail.com/tests/new
I read the documentation: https://developers.google.com/gmail/markup/getting-started#your_first_markup
And this is what I want (for example). Normally I want a normal URL Click action. Reservation is the next level.
First test was the JSON-LD one:
<html>
<body>
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "EventReservation",
"reservationNumber": "IO12345",
"underName": {
"#type": "Person",
"name": "John Smith"
},
"reservationFor": {
"#type": "Event",
"name": "Google I/O 2013",
"startDate": "2013-05-15T08:30:00-08:00",
"location": {
"#type": "Place",
"name": "Moscone Center",
"address": {
"#type": "PostalAddress",
"streetAddress": "800 Howard St.",
"addressLocality": "San Francisco",
"addressRegion": "CA",
"postalCode": "94103",
"addressCountry": "US"
}
}
}
}
</script>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: John Smith<br/>
Event: Google I/O 2013<br/>
Start time: May 15th 2013 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>
Then I tried to use this Microdata thing:
<html>
<body>
<div itemscope itemtype="http://schema.org/EventReservation">
<meta itemprop="reservationNumber" content="IO12345"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="John Smith"/>
</div>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
<meta itemprop="name" content="Google I/O 2013"/>
<time itemprop="startDate" datetime="2013-05-15T08:30:00-08:00"/>
<div itemprop="location" itemscope itemtype="http://schema.org/Place">
<meta itemprop="name" content="Moscone Center"/>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="800 Howard St."/>
<meta itemprop="addressLocality" content="San Francisco"/>
<meta itemprop="addressRegion" content="CA"/>
<meta itemprop="postalCode" content="94103"/>
<meta itemprop="addressCountry" content="US"/>
</div>
</div>
</div>
</div>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: John Smith<br/>
Event: Google I/O 2013<br/>
Start time: May 15th 2013 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>
But I never see this button. In the source code of the mail I see this:
Delivered-To: test#example.org
Date: Sun, 06 Mar 2016 22:40:14 +0000
From: putsmail#putsmail.litmus.com
To: test#example.org
Message-ID: <56dcb1cec7e4_33fda3a013ebc7595d#4fa974b3-34c5-49ef-99b3-2597dbeeb787.mail>
Subject: test
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="--==_mimepart_56dcb1ceba24_33fda3a013ebc75828";
charset=UTF-8
Content-Transfer-Encoding: 7bit
----==_mimepart_56dcb1ceba24_33fda3a013ebc75828
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
----==_mimepart_56dcb1ceba24_33fda3a013ebc75828
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
<html>
<body>
<div itemscope itemtype="http://schema.org/EventReservation">
<meta itemprop="reservationNumber" content="IO12345"/>
<meta itemprop="reservationStatus" content="Ok"/>
<div itemprop="underName" itemscope itemtype="http://schema.org/Person">
<meta itemprop="name" content="John Smith"/>
</div>
<div itemprop="reservationFor" itemscope itemtype="http://schema.org/Event">
<meta itemprop="name" content="Google I/O 2013"/>
<time itemprop="startDate" datetime="2013-05-15T08:30:00-08:00"/>
<div itemprop="location" itemscope itemtype="http://schema.org/Place">
<meta itemprop="name" content="Moscone Center"/>
<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="800 Howard St."/>
<meta itemprop="addressLocality" content="San Francisco"/>
<meta itemprop="addressRegion" content="CA"/>
<meta itemprop="postalCode" content="94103"/>
<meta itemprop="addressCountry" content="US"/>
</div>
</div>
</div>
</div>
<p>
Dear John, thanks for booking your Google I/O ticket with us.
</p>
<p>
BOOKING DETAILS<br/>
Reservation number: IO12345<br/>
Order for: John Smith<br/>
Event: Google I/O 2013<br/>
Start time: May 15th 2013 8:00am PST<br/>
Venue: Moscone Center, 800 Howard St., San Francisco, CA 94103<br/>
</p>
</body>
</html>
----==_mimepart_56dcb1ceba24_33fda3a013ebc75828--
Maybe you know how this works?
You need to send the email from your own account or get whitelisted and authenticate the mail via DKIM or SPF. See https://developers.google.com/gmail/markup/registering-with-google for more details.
I have a simple Email whose body is in HTML.
This is the simple HTML:
<html>
<head>
<meta charset="utf-8">
<link href="http://fonts.googleapis.com/css?family=Titillium+Web:200,300,400,600" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.ticket_holder {
width:800px;
height:480px;
background-image:url(http://www.domain.com/img/sorteos/billete_sorteo_24-07-2015.jpg);
float:left;
margin:10px auto;
position:relative;
}
.ticket_number {
width:277px;
height:60px;
text-align:center;
position:absolute;
top:290px;
left:450px;
font-size:42px;
color:#11AA00;
font-family: Titillium Web, sans-serif;
font-weight:bold;
}
</style>
</head>
<body>
<div class="ticket_holder">
<div class="ticket_number">0236</div>
</div>
</body>
</html>
Now, I will show the content of the Email gotten from a Gmail account. I think there must be an issue related to header but have no idea what should it is.
Delivered-To: fran#gmail.com
Received: by 10.37.71.193 with SMTP id u184csp169517yba;
Fri, 10 Jul 2015 12:10:37 -0700 (PDT)
X-Received: by 10.129.105.213 with SMTP id e204mr24861296ywc.97.1436555437024;
Fri, 10 Jul 2015 12:10:37 -0700 (PDT)
Return-Path: <bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com>
Received: from mail136-7.atl41.mandrillapp.com (mail136-7.atl41.mandrillapp.com. [198.2.136.7])
by mx.google.com with ESMTPS id k7si6464663ykd.6.2015.07.10.12.10.36
for <apalabrados.co#gmail.com>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Fri, 10 Jul 2015 12:10:36 -0700 (PDT)
Received-SPF: pass (google.com: domain of bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com designates 198.2.136.7 as permitted sender) client-ip=198.2.136.7;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com designates 198.2.136.7 as permitted sender) smtp.mail=bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com;
dkim=pass header.i=#mail136-7.atl41.mandrillapp.com;
dkim=pass header.i=#mandrillapp.com
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=mandrill; d=mail136-7.atl41.mandrillapp.com;
h=From:Sender:Subject:Reply-To:To:Message-Id:Date:MIME-Version:Content-Type; i=contacto#mail136-7.atl41.mandrillapp.com;
bh=QTHxKn1Liqi9ZJNIUiIqQFl0DNg=;
b=Wep3W+aIvU17Xwa1SNM0he9Bf403lXYidvKGtwiZpb9QrccWY0DBqImsEqnEGNBKMdSpTd/MdyYW
k2bgPf/yqHdwNXPDsqS3naEEs/gJC7dfIU+2zvGKp2fpGKsKyzhHkWITEMKV5DoMs3WPNKEPxopx
l7GY4JpTaaSm7f+4B3M=
DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=mail136-7.atl41.mandrillapp.com;
b=JIWGJJlHUZt5grcY4at3yqUabbvCI/KrS/VNplK+n+Ty9cDuCQQEANkExNamBojv+SMXsL8URPnl
igpbzKkhUk1WEvjufNYp6pZxAPkjHljuLpA+XdnYlgjCzvWJ4gI1QRuq3v5OeXxP6fcebsMSJrhn
rKWFKYfrMCpZx8v4NXk=;
Received: from pmta04.mandrill.prod.atl01.rsglab.com (127.0.0.1) by mail136-7.atl41.mandrillapp.com id hk0cao1sb1ko for <apalabrados.co#gmail.com>; Fri, 10 Jul 2015 19:09:11 +0000 (envelope-from <bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com>)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
i=#mandrillapp.com; q=dns/txt; s=mandrill; t=1436555350; h=From :
Sender : Subject : Reply-To : To : Message-Id : Date : MIME-Version :
Content-Type : From : Subject : Date : X-Mandrill-User :
List-Unsubscribe; bh=N1DazcpdS55HBslvogsYDTv2iLdRO0rnUDZkh9PCbtQ=;
b=OjcMKaAC4K4s1I3fpjFwqMGbYcayh7661XLVARyfmap3g1zZMW/+FWtGU2rzKrIF7wNbtC
+4E06pOycBBa7Q/D6BGk8CtLQLtWBe260o9X7d4gvBAl70/t0zyqbkucPx82AKzXe956cwsB
wiBB9xxxmgQdq/LJsmax3b1/+ZRWk=
From: "Contacto impresoras3d.com" <contacto#impresoras3d.com>
Sender: "Contacto impresoras3d.com" <contacto#mail136-7.atl41.mandrillapp.com>
Subject: =?utf-8?Q?Combinaci=C3=B3n=20Sorteo=2024/07/2015?=
Return-Path: <bounce-md_30672132.55a01856.v1-94c0ce7842b842caaa20ee481b5d5bda#mandrillapp.com>
Received: from [188.165.162.97] by mandrillapp.com id 94c0ce7842b842caaa20ee481b5d5bda; Fri, 10 Jul 2015 19:09:10 +0000
Reply-To: <contacto#impresoras3d.com>
To: <apalabrados.co#gmail.com>
X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse#mandrill.com
X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30672132.94c0ce7842b842caaa20ee481b5d5bda
X-Mandrill-User: md_30672132
Message-Id: <30672132.20150710190910.55a01856de9973.48448148#mail136-7.atl41.mandrillapp.com>
Date: Fri, 10 Jul 2015 19:09:10 +0000
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="_av-M8imh9jmVCY5HVEL4ea0TA"
--_av-M8imh9jmVCY5HVEL4ea0TA
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
0236
--_av-M8imh9jmVCY5HVEL4ea0TA
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta charset="utf-8">
<link href="http://fonts.googleapis.com/css?family=Titillium+Web:200,300,400,600" rel="stylesheet" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.ticket_holder {
width:800px;
height:480px;
background-image:url(http://www.impresoras3d.com/img/sorteos/billete_sorteo_24-07-2015.jpg);
float:left;
margin:10px auto;
position:relative;
}
.ticket_number {
width:277px;
height:60px;
text-align:center;
position:absolute;
top:290px;
left:450px;
font-size:42px;
color:#11AA00;
font-family: Titillium Web, sans-serif;
font-weight:bold;
}
</style>
</head>
<body>
<div class="ticket_holder">
<div class="ticket_number">0236</div>
</div>
<img src="http://mandrillapp.com/track/open.php?u=30672132&id=94c0ce7842b842caaa20ee481b5d5bda" height="1" width="1"></body>
</html>
--_av-M8imh9jmVCY5HVEL4ea0TA--
Gmail strips the head tag and many email clients give limited support on styling of div tags. Your best bet is to convert the div to tables and inline the styles. See here for CSS compatability and here for an inliner.
I have try to standardize signature in my company.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<style type="text/css">
h1 {font-size: 14pt; font-family: "Segoe UI", Arial,sans-serif; color:#F79646;margin-bottom:0;font-weight:normal;}
h2 {font-size: 11pt; font-family: "Segoe UI", Arial,sans-serif;margin-bottom:1em;margin-top:0;font-weight:normal;}
.email {font-size: 10pt; font-family: "Segoe UI", Arial, sans-serif; color:blue;text-decoration:underline;}
p {font-size: 10pt; font-family: "Segoe UI", Arial, sans-serif; margin-bottom:0;margin-top:0;}
.nazwafirmy {font-size:12pt; font-family: 'Segoe UI', Arial, sans-serif; margin-bottom:0;margin-top:0; color:#F79646;}
a {text-decoration:underline; color:blue;}
.danefirmy {color:#A6A6A6;}
.danefirmy b {color:gray; font-weight:normal;}
.infoprawne {font-size:8pt; color:#A6A6A6;}
</style>
</head>
<body>
<br /><br />
<p>Pozdrawiam,</p>
<h1>%%displayname%%</h1>
<h2>%%title%%</h2>
<p class="email">%%email%%</p>
<p>%%mobilenumber%%</p><br />
</p>
</body>
</html>
Everything is working fine and the information is added when the message is sent. But there is one proble: When I send the first email the signature is ok – it’s on the bottom of the email message. When somebody sends me a message and I answer it, the signature will be added on the bottom of this message – not above on the message that was sent to me.
Example:
<My answer.>
-----------------------------------------
<Message sent to me.>
<Email Signature>
-----------------------------------------
<My signature answer.>
I tried to use "Prepend" but this is the result:
<SIGNATURE>
<Message>
Is there any solution to configure the transport rule, so that the signature will be added above the message that I answer and not below it when I answer an email?
No, there's not a way to do this. I would look at a third party app like Exclaimer - http://www.exclaimer.com/products/signature-manager/default.aspx.