Action button not showing when sending to other gmail account

爷,独闯天下 提交于 2021-02-19 01:29:16

问题


My ViewAction button is working fine when using the Apps Script to send the email to myself. (Same gmail account as logged in)

function testSchemas() {
  var htmlBody = HtmlService.createHtmlOutputFromFile('mail_template').getContent();

  MailApp.sendEmail({
    to: "myemail@gmail.com",
    subject: 'Test Actions in the Inbox - ' + new Date(),
    htmlBody: htmlBody    
  });
}

When setting another gmail account as recipient, the action button won't display. I've tried several gmail accounts.

By the look of it, testing schemas is currently only possible when sending to one self and not to other gmail accounts. Is this true?

My action button:

<html>
  <head>
    <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EmailMessage",
  "action": {
    "@type": "ViewAction",
    "name": "Test Action",
    "url": "https://mydomain.com/test"
  },
  "description": "Test action"
}
</script>
</head>
<body>
    <p>
      This a test for a Go-To action in Gmail.
    </p>
</body>
</html>

Working Headers:

Delivered-To: myemail@gmail.com
Received: by 10.112.167.104 with SMTP id zn8csp127915lbb;
        Tue, 13 Aug 2013 01:44:42 -0700 (PDT)
Return-Path: <3-fEJUhEJAJoG4LE.FIQ8.M6BQ8CTAG4CF.6IG@maestro.bounces.google.com>
Received-SPF: pass (google.com: domain of 3-fEJUhEJAJoG4LE.FIQ8.M6BQ8CTAG4CF.6IG@maestro.bounces.google.com designates 10.224.2.202 as permitted sender) client-ip=10.224.2.202
Authentication-Results: mr.google.com;
       spf=pass (google.com: domain of 3-fEJUhEJAJoG4LE.FIQ8.M6BQ8CTAG4CF.6IG@maestro.bounces.google.com designates 10.224.2.202 as permitted sender) smtp.mail=3-fEJUhEJAJoG4LE.FIQ8.M6BQ8CTAG4CF.6IG@maestro.bounces.google.com;
       dkim=pass header.i=@gmail.com
X-Received: from mr.google.com ([10.224.2.202])
        by 10.224.2.202 with SMTP id 10mr4378787qak.8.1376383481951 (num_hops = 1);
        Tue, 13 Aug 2013 01:44:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:message-id:date:subject:from:to:content-type;
        bh=YNbTe5hF82u8UBHoyJqTFWAtXaO3n1xZ0aL3mDu5ycM=;
        b=DAjFv8v0ScIjF0VY1Ec1rtGmfvJ5WAem5TQmyhYt2b24B3fmYy2VEuvScnX4id+4Pi
         D48Uq8DE2Qoj+N18HZRY+tVnyYdJATrlNfe6FCrQK2Ktue79ox/im5t7lrI5C6WZvXlm
         TppcL8bOtFoX7y2FE011kGn0vmFSMOWPNbrynbexRJTyafWJrRzhJ6Z8oXfDfdYaY9fG
         OALcOrMwUd6+KXAZGj5qJhZ/hUEIC5KbaXYwonJoaFDJkZ2zPkV2DHAzY78vLOzcD37g
         zg43n1rify+udKSvlY9oRnHmAwsu+Sb4ddQ8jtJBQRpw8+MoV9zRKhQgLUdvZU/nmmb4
         c8OQ==
MIME-Version: 1.0
X-Received: by 10.224.2.202 with SMTP id 10mr3639307qak.8.1376383481552; Tue,
 13 Aug 2013 01:44:41 -0700 (PDT)
Message-ID: <001a11c3e1827e3ff904e3d040f8@google.com>
Date: Tue, 13 Aug 2013 08:44:41 +0000
Subject: Test Actions in the Inbox - Tue Aug 13 2013 10:44:41 GMT+0200 (CEST)
From: myemail@gmail.com
To: myemail@gmail.com
Content-Type: multipart/alternative; boundary=001a11c3e1827e3fef04e3d040f5

Not working headers:

Delivered-To: myother@gmail.com
Received: by 10.76.9.231 with SMTP id d7csp139739oab;
        Tue, 13 Aug 2013 01:44:49 -0700 (PDT)
Return-Path: <myemail@gmail.com>
Received-SPF: pass (google.com: domain of myemail@gmail.com designates 10.236.38.106 as permitted sender) client-ip=10.236.38.106
Authentication-Results: mr.google.com;
       spf=pass (google.com: domain of myemail@gmail.com designates 10.236.38.106 as permitted sender) smtp.mail=myemail@gmail.com;
       dkim=pass header.i=@gmail.com
X-Received: from mr.google.com ([10.236.38.106])
        by 10.236.38.106 with SMTP id z70mr1926602yha.29.1376383489428 (num_hops = 1);
        Tue, 13 Aug 2013 01:44:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:message-id:date:subject:from:to:content-type;
        bh=0ZsOg3hkpKeRGvrg8ym5j4ArBI++UJSNWp46KyrSIsU=;
        b=faCKadLjkifGzASnhw5FkjbOmo+brPDsEnzZuP5EmhzRxUzBoM2+7IM2oYTEvDDk7V
         Ib51o8EJ2g3sxP1yo6F+xdaldOcFZ65x3HiZn35hzyagzYHq/ASD/IJJb7rxQmYbmNM9
         zEMe71JAI1h/Wh9DJUG1vA7+AF83ApJwkeFZWOSRSKDBPAcOTZ7bIe2ymxJgp8mOq7mz
         /BLDtPPOoq4XZ5aeapEFUvMSpKCKkA/l5hlNk7Tnhv/EuEKl0RK7xYrnIXgtaFKgpRJ4
         hkaP+EaQNrFdj3WtvBNVeFl1VFcgHYu3padPKbkWTTBuCljICvot67ru6oX9IqrqGA8O
         bayA==
MIME-Version: 1.0
X-Received: by 10.236.38.106 with SMTP id z70mr1246078yha.29.1376383489312;
 Tue, 13 Aug 2013 01:44:49 -0700 (PDT)
Message-ID: <089e01184c56f4944a04e3d040eb@google.com>
Date: Tue, 13 Aug 2013 08:44:49 +0000
Subject: Test Actions in the Inbox - Tue Aug 13 2013 10:44:49 GMT+0200 (CEST)
From: myemail@gmail.com
To: myother@gmail.com
Content-Type: multipart/alternative; boundary=089e01184c56f4944004e3d040e8

回答1:


Your sender address needs to be whitelisted to send actions to other users:

https://developers.google.com/gmail/schemas/registering-with-google

For testing purposes, when sending emails to yourself the whitelisting requirements are ignored.



来源:https://stackoverflow.com/questions/18204792/action-button-not-showing-when-sending-to-other-gmail-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!