Javascript Can';t让gmail一键确认操作按钮工作

Javascript Can';t让gmail一键确认操作按钮工作,javascript,gmail,schema.org,google-schemas,Javascript,Gmail,Schema.org,Google Schemas,我遵循此处所述的指导原则 但它不会出现在我面前。如上所述 自我测试 您可以轻松地测试标记是否端到端正常工作 向您的Gmail帐户发送带有模式的电子邮件。所有电子邮件在哪里 发件人和收件人是同一个帐户忽略 注册要求,可用于自检 我使用相同的gmail地址发送和发送邮件,如下所示 GradeCard gc = new GradeCard("105106265", "BTS"); var m = new UserMailer().ConfirmSubscription("Shashwat", "us

我遵循此处所述的指导原则

但它不会出现在我面前。如上所述

自我测试

您可以轻松地测试标记是否端到端正常工作 向您的Gmail帐户发送带有模式的电子邮件。所有电子邮件在哪里 发件人和收件人是同一个帐户忽略 注册要求,可用于自检

我使用相同的gmail地址发送和发送邮件,如下所示

GradeCard gc = new GradeCard("105106265", "BTS");
var m = new UserMailer().ConfirmSubscription("Shashwat", "user@email.com", new WatchListEmail() { fullName = "from Model", gc = gc });

Response.Write(m.Body);

var client = new SmtpClient("smtp.gmail.com", 587)
{
    Credentials = new NetworkCredential("user@email.com", "xxxxx"),
    EnableSsl = true
};

client.Send(m);
生成邮件的HTML如下所示

<!DOCTYPE html>

<html>
<body>
    <div style="width: 600px; margin: auto; font-family: 'Segoe UI';">
        <h1 style="font-weight:lighter; border-bottom:1px solid #808080; padding:5px 0;">example.com</h1>
        <h3 style="font-weight:lighter;">Action Required. Confirm your subscription for EN abc</h3>
        <p>
            Dear <b>abc</b>
        </p>
        <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EmailMessage",
  "description": "Action Required. Confirm your subscription for EN 105106265",
  "action": {
    "@type": "ConfirmAction",
    "name": "Add to watchlist",
    "handler": {
      "@type": "HttpActionHandler",
      "url": "http://www.myignou.com?a=1&b=2"
    }
  }
}
</script>

<p>As you requested, We have just added your subscription to the following detailed enrollment number</p>
<p>
    ...
</p>
<p>
    Click <a href="http://www.myignou.com?a=1&b=2">here to confirm</a>
</p>
<div style="margin:10px 0;">
    <p>
        Here is your most recent copy of grade card as on <b>05-09-2013 00:03:37</b><br />
        Changeset ID: xxx
    </p>

    <table style="width: 100%; text-align: center; border-collapse: collapse;">
        ....
    </table>
    <h3 style="font-weight: lighter;">Other previous changes</h3>
        <div style="padding: 10px">
            <h4 style="font-weight: lighter; margin: 0">Updated on 03-09-2013 15:15:20</h4>
            <div>Changeset ID: abc</div>
            <div>
                ...
            </div>
        </div>
        <div style="padding: 10px">
            <h4 style="font-weight: lighter; margin: 0">Updated on 03-09-2013 15:14:21</h4>
            <div>Changeset ID: xxx</div>
            <div>
                ...
            </div>
        </div>
        <div style="padding: 10px">
            <h4 style="font-weight: lighter; margin: 0">Updated on 03-09-2013 15:14:21</h4>
            <div>Changeset ID: abca</div>
            <div>
                ...
            </div>
        </div>
    </div>
        <div style="padding: 10px; margin: 20px 0; background-color: #f2f0f0; font-size: 85%; color: #686868;">
            <b>&copy; 2013 myIGNOU.com</b><br />

        </div>
    </div>
</body>
</html>

example.com
需要采取的行动。确认您对EN abc的订阅

亲爱的abc

{ “@context”:”http://schema.org", “@type”:“EmailMessage”, “说明”:“所需操作。确认您订阅的EN 105106265”, “行动”:{ “@type”:“confirmation”, “名称”:“添加到观察列表”, “处理人”:{ “@type”:“HttpActionHandler”, “url”:”http://www.myignou.com?a=1&b=2" } } } 根据您的要求,我们刚刚将您的订阅添加到以下详细的注册号

...

点击

这是您截至2013年9月5日00:03:37的最新成绩卡副本
变更集ID:xxx

.... 以前的其他变化 更新日期:2013年9月3日15:15:20 变更集ID:abc ... 更新日期:2013年9月3日15:14:21 变更集ID:xxx ... 更新日期:2013年9月3日15:14:21 变更集ID:abca ... &抄袭;2013 myIGNOU.com

如果您检查电子邮件标题,我希望找不到DKIM/SPF签名,这是自测所必需的。如果没有签名,任何人都可以伪造您的电子邮件地址,并向您发送不需要的电子邮件和操作。

您必须先获得谷歌的批准,才能使其正常工作。

为此:

  • 将包含电子邮件的已验证架构发送到特殊的google电子邮件地址(使用此工具:)。。。然后:

  • 填写“Gmail Schema白名单请求”表格,该表格描述了您的网站以及您打算如何使用一键操作。以下是表格:


  • 谢谢你的回复。正如你在另一个回答中所建议的那样。我用script.google.com成功地测试了它。但是,当从谷歌账户(gmail)发送电子邮件时,有没有办法添加DKIM/SPF签名?DKIM使用域密钥,因此您需要一个谷歌应用程序域来完成此操作是的,DKIM/SPF签名是必需的。即使使用相同的发件人和收件人电子邮件地址,也无法对其进行测试。我正在使用ManDrilApp。这是有效的@拉胡尔乔达里