问题描述
我正在遵循此处描述的指南
https://developers.google.com/gmail/schemas/reference/one-点击动作
但它只是不会出现在我面前.如所述这里
<块引用>自测
您可以通过以下方式轻松测试您的标记是否在端到端正常工作将带有架构的电子邮件发送到您的 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 = 真};client.Send(m);生成邮件的HTML是这样的
<!DOCTYPE html><html><身体><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;">需要操作.确认订阅 EN abc</h3><p>亲爱的<b>abc</b></p><脚本类型="应用程序/ld+json">{"@context": "http://schema.org","@type": "EmailMessage","description": "需要采取行动.确认订阅 EN 105106265",行动": {"@type": "确认操作","name": "加入关注列表",处理程序":{"@type": "HttpActionHandler",网址":http://www.myignou.com?a=1&b=2"}}}</脚本><p>根据您的要求,我们刚刚将您的订阅添加到以下详细注册号中</p><p>...</p><p>点击<a href="http://www.myignou.com?a=1&b=2">这里确认</a></p><div style="margin:10px 0;"><p>这是您最新的成绩卡副本,日期为 <b>05-09-2013 00:03:37</b><br/>变更集 ID:xxx</p><table style="width: 100%; text-align: center;border-collapse:collapse;">……</表><h3 style="font-weight:lighter;">之前的其他改动</h3><div style="padding: 10px"><h4 style="font-weight:lighter; margin: 0">更新于03-09-2013 15:15:20</h4><div>变更集 ID:abc</div>...</div></div><div style="padding: 10px"><h4 style="font-weight:lighter; margin: 0">更新于03-09-2013 15:14:21</h4><div>变更集 ID:xxx</div>...</div></div><div style="padding: 10px"><h4 style="font-weight:lighter; margin: 0">更新于03-09-2013 15:14:21</h4><div>变更集 ID:abca</div>...</div></div></div><div style="padding: 10px; margin: 20px 0; background-color: #f2f0f0; font-size: 85%; color: #686868;"><b>&复制;2013 myIGNOU.com</b><br/></div></div></身体></html> 解决方案 如果您检查电子邮件标头,我预计找不到 DKIM/SPF 签名,即使是自测也是必需的.如果没有签名,任何人都可以欺骗您的电子邮件地址并向您发送不需要的电子邮件.
I am following the guidelines as described here
https://developers.google.com/gmail/schemas/reference/one-click-action
But It's just wont appear for me. As described here
Self testing
You can easily test if your markup is working correctly end-to-end by
sending emails with schemas to your Gmail account. All emails where
the sender and the recipient are the same account ignore the
registration requirements and can be used for self-testing.
I am using my same gmail address in both to and from address like below
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 of generated mail is like this
<!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>© 2013 myIGNOU.com</b><br />
</div>
</div>
</body>
</html>
解决方案 If you check the email headers, I'd expect that no DKIM/SPF signature can be found, and that is required even for self-testing. Without the signature, anyone can spoof your email address and send you unwanted email with actions.
这篇关于无法让gmail一键确认操作按钮工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End
相关推荐
在JavaScript中,我们有多种方法可以删除数组中的指定元素。以下给出了5种常见的方法并提供了相应的代码示例: 1.使用splice()方法: let array = [0, 1, 2, 3, 4, 5];let index = array.indexOf(2);if (index -1) { array.splice(index, 1);}// array = [0,...
2024-11-22
前端开发问题
182
在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会...
2024-10-18
前端开发问题
301
问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转...
2024-10-17
前端开发问题
437
如果你想在 layui 的 table 列表中增加 edit=date 属性但不生效,可能是以下问题导致的: 1. 缺少日期组件的初始化 如果想在表格中使用日期组件,需要在页面中引入 layui 的日期组件,并初始化: script type="text/javascript" src="/layui/layui.js"/scrip...
2024-06-11
前端开发问题
455
Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)...
2024-04-20
前端开发问题
5
CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)...
2024-04-20
前端开发问题
13
热门文章
1错误 [ERR_REQUIRE_ESM]:不支持 ES 模块的 require()
2vue中yarn install报错:info There appears to be trouble with you
3为什么 Chrome(在 Electron 内部)会突然重定向到 chrome-error://chromewebdat
4“aria-hidden 元素不包含可聚焦元素"显示模态时的问题
5使用选择器在 CSS 中选择元素的前一个兄弟
6js报错:Uncaught SyntaxError: Unexpected string
7layui怎么刷新当前页面?
8将模式设置为“no-cors"时使用 fetch 访问 API 时出错
热门精品源码
最新VIP资源
1多功能实用站长工具箱html功能模板
2多风格简历在线生成程序网页模板
3论文相似度查询系统源码
4响应式旅游景点宣传推广页面模板
5在线起名宣传推广网站源码
6酷黑微信小程序网站开发宣传页模板
7房产销售交易中介网站模板
8小学作业自动生成程序


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)