question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Motivation

Email is a cornerstone of many consumer and enterprise workflows. However the content that is sent in an email message is still limited — messages are static, can become out of date, and are not actionable without opening a browser.

Our goal is to enhance and modernize the email experience through added support for dynamic content and interactivity while keeping users safe. We propose to do this by allowing email publishers to embed AMP directly in a message body as a new MIME part—text-x-amphtml—which will be rendered by email clients (with graceful fallback to non-AMP content). Our proposed name for this project is “AMPHTML Email”.

Compared to websites, email is a different user context with different models of privacy and security. For example, phishing is a major concern for email. To maintain users’ expectations of security and privacy, we’ll only allow a conservative subset of AMP functionality. To enforce this, we propose adding a new AMPHTML email validation spec identified by a new attribute on the document element: amp4email. This is similar to the technique used by the AMPHTML Ads project which introduced its own spec that uses the attribute amp4ads .

Requirements

  • Supports modern phishing and spam mitigation strategies
  • Supports preserving privacy expectations of modern email providers

Proposed design

A minimal document:

<!doctype html>
<html ⚡4email> <!-- `amp4email` also accepted. -->
<head>
  <meta charset="utf-8">
  <style amp4email-boilerplate>body{visibility:hidden}</style>
  <script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
Hello, world.
</body>
</html>

Note the lack of a <link rel=canonical> element compared to the traditional AMP spec. This is because an AMP email doesn’t have a canonical email. The boilerplate CSS is also simpler.

After a security review, the components below have been found to be secure in an email context:

Dynamic content

  • amp-form
  • amp-selector
  • amp-bind & amp-state
  • amp-list
  • amp-mustache

Presentation

  • amp-accordion
  • amp-carousel
  • amp-sidebar
  • amp-image-lightbox
  • amp-lightbox
  • amp-fit-text
  • amp-timeago

Media

  • amp-img
  • amp-anim

Caveats

  1. All fetchable attributes like src and href must be static (i.e. cannot be mutated by amp-bind) so they can be inspected by spam/phishing filters
  2. All network requests must be proxy-able to prevent leaking of users’ IP address, setting cookies, etc.

/cc @raywainman @zhangsu @jasti

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:232
  • Comments:113 (27 by maintainers)

github_iconTop GitHub Comments

100reactions
drekicommented, Feb 13, 2018

AMP is unnecessary. By embracing it, it results in a de facto ‘ownership’ of the lingua franca of the internet by a huge, monolithic corporation that already has an outsized influence on culture and technology.

I’d rather have my plain old ‘unsafe’ internet.

51reactions
matijagrciccommented, Feb 13, 2018

This is huge given how consumer behavior has changed over years, but email has not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AMP Email - amp.dev
The AMP email format provides a subset of AMPHTML components for use in email messages, that allows recipients of AMP emails to interact...
Read more >
AMP for Gmail - Google Developers
This dynamic email format provides a subset of AMPHTML components for use in email messages, that allows recipients of AMP emails to interact...
Read more >
Getting Started with AMP for Email on SparkPost
The AMPHTML Email format provides a subset of AMP components, like carousels, responsive form elements, and the ability to retrieve fresh content from...
Read more >
What is AMP | How to Use AMP for Email by Email on Acid
AMP HTML email can natively slot in beside your current text and HTML emails. AMP is simply another email MIME type, helping a...
Read more >
amphtml/amp-email-css.md at main - GitHub
Supported CSS in AMP for Email. This document outlines the CSS features currently supported inside AMP emails. Applying CSS. Internal stylesheet.
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found