6

使用 Apps 脚本向自己发送电子邮件时,我的 ViewAction 按钮工作正常。(与登录相同的gmail帐户)

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    
  });
}

将另一个 gmail 帐户设置为收件人时,不会显示操作按钮。我已经尝试了几个 gmail 帐户。

从表面上看,目前只有在发送给一个自己而不是发送给其他 gmail 帐户时才能测试模式。这是真的?

我的操作按钮:

<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>

工作标题:

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

不工作的标题:

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
4

1 回答 1

16

您的发件人地址需要被列入白名单才能向其他用户发送操作:

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

出于测试目的,在向自己发送电子邮件时,白名单要求将被忽略。

于 2013-08-14T06:03:18.413 回答