问题标签 [amp-email]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
844 浏览

amp-html - 使用 amp-list 在 AMP4HTML 中创建动态 amp-carousel

我想使用 amp-list 为 AMP4Email 创建一个动态 amp-carousel。

我在这里构建了一个通过验证的模板,但是将其放入https://amp.gmail.dev/playground/时,轮播不起作用。

AMP4Email 无法做到这一点吗?通常基于,它似乎在 AMP 中运行良好。

渲染轮播的代码部分

0 投票
2 回答
486 浏览

amp-html - 如何将 Roboto 字体添加到 AMP 4 电子邮件

当我添加这个时,我收到一个错误The AMP Validator

我应该如何在amp4email.

0 投票
1 回答
1116 浏览

node.js - Use nodemailer to send AMP email

I recently came to know about AMP email and found it interesting and tried an example in nodejs using nodemailer package.

This package already contains an option 'amp' to send AMP specific emails, however I am unable to make it work.

The AMP version of email is really plain and it doesnt contain any xhr requests. Below is my code which sends an email to a specific email address.

Also, I tried using "MailKit" package in C# but was not sure how to set an AMP version here. I added my AMP version under message.body section of MimeMessage class.

I am sure there is something really small that I am missing but unable to figure it out. Could someone take a look and guide me whats going wrong with above code?

0 投票
1 回答
863 浏览

cors - AMP Email Playground 的正确 AMP-Access-Control-Allow-Source-Origin 响应标头是什么?

0 投票
2 回答
176 浏览

amp-html - AMP 电子邮件广告 - 不支持“amp-ad”组件

我们公司拥有常规文章和新闻页面的 AMP 页面版本。我们正在使用该amp-ad组件在这些页面上展示广告。

我们还有多种带有广告展示位置的 HTML 通讯产品。我正在研究 AMP4EMAIL 的 POC,并且缺乏关于此货币化的文档。该amp-ad标签不在电子邮件组件列表中。是否有有效的规范选项来展示广告?可以为 AMP 电子邮件广告使用 AMP amp-img/ 或常规 HTML标签吗?a

对我们来说,遵守规则很重要,以避免 AMP 电子邮件的 Google 注册过程出现问题或其他未来问题。

我尝试在电子邮件验证器amp-ad中使用该标签,但验证失败。电子邮件游乐场输出包含相同的错误,但显示了广告!

验证器输出 2 个错误:

  • Custom JavaScript is not allowed.- 关于amp-ad头上的脚本。
  • The tag 'amp-ad' is disallowed.
0 投票
2 回答
226 浏览

amp-html - Amp for Email 和 Google 字体验证错误

根据 AMP 文档,字体允许使用链接标签: https ://amp.dev/documentation/guides-and-tutorials/develop/style_and_layout/custom_fonts/?format=websites

然而,当我在头部嵌入一个谷歌字体链接标签时:

<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">

我收到验证错误:不允许使用标签“链接”。

有什么见解吗?感谢您的时间和想法。

0 投票
2 回答
986 浏览

amp-html - amp-state 中是否允许 src 属性

我试图用来自 API 的数据填充 AMP 状态,用于 AMP 电子邮件。我们需要从 API 提供数据,因为它可以同时动态变化。

根据AMP4email 文档,状态可以从子<script>元素或src包含 CORS URL 到远程 JSON 端点的属性填充,但不能同时填充。

实际上,添加srcamp-state将引发以下验证错误: The attribute 'src' may not appear in tag 'amp-state (AMP4EMAIL)'AMP 游乐场

您可以通过将以下代码复制到 Playground 来测试它。

这是官方验证器的问题,还是文档的问题?

0 投票
0 回答
795 浏览

gmail - 从 AWS SES 发送 AMP 电子邮件时,GMAIL 上未显示

当尝试使用 python 脚本查看从 AWS SES 接收的 AMP 邮件时,我只能看到 HTML 部分,而看不到 AMP 部分。我在网络/桌面(不是移动设备)上使用 Gmail。

我已经能够从 Gmail amp 游乐场 ( https://amp.gmail.dev/playground/ ) 收到电子邮件,但不能从我的域中收到电子邮件(使用我的域的开发人员选项)。我已获得先决条件的资格,例如我的域的 DKIM、DMARC 和 SPF - 我已附上此资格的屏幕截图。我已确保我的邮件仅包含最少的 AMP 内容,并且 MIME 树的组织有序(AMP 出现在 HTML 之前)。

这是我在 Gmail 上收到的邮件:

我希望在我的 Gmail 网络桌面客户端中看到 AMP 部分。我做错了什么?

0 投票
1 回答
773 浏览

amp-html - 如何制作“根据输入字符串上的get api调用检索的数据显示动态选项列表的搜索框”,如amp邮件中的select2

我是 AMP 电子邮件技术的新手,我面临一个与在搜索框中呈现动态选项相关的问题,这使得根据输入字符串获取 API 请求调用作为查询,并根据请求检索的数据显示选项列表。

我开始知道 amp-autocomplete 在 amp-email 中不起作用,我使用此代码。因此,请考虑这一点并提出解决此问题的方法。

此代码显示了一个输入字段,但在其上书写时我无法获得任何列表。

“ https://www.example.com/a/b?q=a ”的获取请求的结果给出了这样的 json 数据 [{"id": "1", "name": "abc"}, {" id": "2", "name": "abd"}, ...]

0 投票
1 回答
192 浏览

amp-html - 检查 amp-accordion 的 Selector-like?

我想知道是否有一种方法可以根据所述手风琴的状态(即折叠或展开)来设置、显示/隐藏手风琴外部的元素。

我看到您可以根据状态在手风琴本身内设置内容样式,但还没有能力说:如果此手风琴空白已展开,请在此处隐藏此图像等。