# Integrate ViewActions/One-Click Actions schemas into Discourse Emails

**URL:** https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056
**Category:** Feature
**Tags:** email
**Created:** [2015年四月1日 08:27 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056 "2015-04-01T08:27:54Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月1日 08:27 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/1 "2015-04-01T08:27:54Z")

</div>

**tl;dr: Buttons that link you to a Discourse post**

Continuing the discussion from [Make activating an Account Gmail-compatible](https://meta.discourse.org/t/make-activating-an-account-gmail-compatible/26024/3):

> [@Make activating an Account Gmail-compatible](https://meta.discourse.org/t/make-activating-an-account-gmail-compatible/26024/3):
>
> [Having a] similar ViewAction button for View on $site\_name [encourages email users to get on the site].

> [@Make activating an Account Gmail-compatible](https://meta.discourse.org/t/make-activating-an-account-gmail-compatible/26024/4):
>
> Having a similar button to these “View Issue” ones from Github would be absolutely great

So anyway, Github emails come with some extra html that makes action buttons appear on GMail and in Inbox, possibly even elsewhere but I’m not aware of any. They look like this:

[![](https://global.discourse-cdn.com/meta/original/3X/3/3/333ffb5cb8d342bf4e3992d1f59469ea5d9692ee.png) ](https://i.imgur.com/z68ltBd.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/8/0/800144db94b827909a4ef8c6d9d2645b7dd2ac2e.png)

```html
<div itemscope itemtype="http://schema.org/EmailMessage">
  <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
    <link itemprop="url" href="https://github.com/syncthing/syncthing/issues/1519#issuecomment-88384950"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

```

```html
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/BuildAPC/BuildAPC-docs/pull/46#issuecomment-88387645"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

```

So in what I could figure out, the itemprop name and the description are not visible at all on GMail but the corresponding string do appear if you Ctrl+F for them on the page source.

Inbox is even weirder as the `itemprop="description"` string is visible on the Issue email but not on the Pull Request one. Possibly caused by the mention.

Would be pretty 🔥 🔥 🔥 if Discourse would use this schema/code/whatever too!

---

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月1日 14:34 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/2 "2015-04-01T14:34:47Z")

</div>

By the way, I noticed Gmail enables this sort of button for Amazon purchase emails too – But Amazon’s emails don’t even contain this schema. It is also localized depending on your Google Account’s language.

Kinda 😠 that they do this.

---

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月3日 12:56 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/3 "2015-04-03T12:56:53Z")

</div>

Reposting my [original post](https://meta.discourse.org/t/make-activating-an-account-gmail-compatible/26024):

* * *

##Make Activating Accounts Gmail-compatible

![](https://global.discourse-cdn.com/meta/original/3X/2/7/27b7a45326506319914f350797f5c05782635022.png)

Mailchimp-sent double-in confirmations always send with them some metadata.

GMail uses this metadata to display a button (just like you can see on the screenshot) that users can click to automatically activate the subscription/account without even opening the email.

See the the bottom of the [email’s source](https://gist.github.com/Moter8/8dc2adf7ea4a328e34b4) to see the used schemes/metadata.

* * *

Also look Google’s [documentation](https://developers.google.com/gmail/markup/reference/one-click-action) about this and a [Mailchimp Blog post](http://blog.mailchimp.com/gmails-inbox-actions-work-with-mailchimp/) about the matter.

* * *

The only issue I can see with this is that the Discourse activation links require the user to click on “Activate Account”.

---

<div class="post-metadata">

### Author: ![Mooash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mooash/32/189167_2.png) [@Mooash](https://meta.discourse.org/u/Mooash)
#### Post date: [2015年四月20日 06:06 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/4 "2015-04-20T06:06:56Z")

</div>

Some example metadata that would work (stolen from a working email but edited):

```plaintext
<div itemscope itemtype="http://schema.org/EmailMessage" style="display:none">
    <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
        <link itemprop="url" href="https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056" />
        <meta itemprop="name" content="View this thread"/>
    </div>
</div>

```

Will see if I can scrounge up a PR if I can work out where the email templates are

---

<div class="post-metadata">

### Author: ![Mooash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mooash/32/189167_2.png) [@Mooash](https://meta.discourse.org/u/Mooash)
#### Post date: [2015年四月22日 10:31 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/5 "2015-04-22T10:31:42Z")

</div>

I’ve made some modifications to the `app/views/email/notification.html.erb ` which adds the basic functionality that this request is after.

My only issue is that it uses the translation for `read_full_topic` which probably isn’t ideal in this situation. It should probably read `View Topic` or something along those lines but I’m having issues adding another translation line.

Any other suggestons before I put in a PR?

[https://github.com/Mooash/discourse/commit/5b89327d18838691db58ba01d2989157c81d43cd](https://github.com/Mooash/discourse/commit/5b89327d18838691db58ba01d2989157c81d43cd)

---

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月22日 12:44 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/6 "2015-04-22T12:44:44Z")

</div>

Is there a possibility to use the user’s language setting? Not sure if it currently does that, but it would be great.

Thanks for working on this ✌ 💗

---

<div class="post-metadata">

### Author: ![Mooash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mooash/32/189167_2.png) [@Mooash](https://meta.discourse.org/u/Mooash)
#### Post date: [2015年四月22日 12:58 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/7 "2015-04-22T12:58:34Z")

</div>

Thats what using the `read_full_topic` place holder does. 🙂 there isn’t any point putting in a pull request that only displays the English language. 😉

---

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月23日 12:44 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/8 "2015-04-23T12:44:53Z")

</div>

> [@Mooash](#):
>
> Any other suggestions before I put in a PR?

I guess you can submit it and one of the maintainers will look at it 🙂

Edit:

[https://github.com/discourse/discourse/commit/9bce812c8faa61cb284ef4a9013462ea90b4922b](https://github.com/discourse/discourse/commit/9bce812c8faa61cb284ef4a9013462ea90b4922b)

It’s live! 👏 👑

---

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月23日 14:55 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/9 "2015-04-23T14:55:23Z")

</div>

Just tried it out on my instance, the schema gets included in the mail but there is no button:

[![](https://global.discourse-cdn.com/meta/original/4X/e/3/8/e38e8521c14cfbbec09304e0c2007ad11fdd286c.png) ](https://i.imgur.com/Umt5CZH.png)

 ![](https://global.discourse-cdn.com/meta/original/4X/d/7/5/d75a7a625a4a82409277a2e9a2846085ae27039c.png)  
^ [Google’s markup tester](https://www.google.com/webmasters/markup-tester/)

* * *

Oh god, I should have read the documentation more. You have to register with google so the button shows up at all.

> **[Register with Google  |  Gmail  |  Google for Developers](https://developers.google.com/workspace/gmail/markup/registering-with-google)**

Some points come up which seem really bad to me:

> Consistent history of sending a high volume of mail from your domain (order of hundred emails a day minimum to Gmail) for a few weeks at least.

> We are currently only approving Go-To actions for very specific high-value usecase with high interaction rate (e.g. Flight Check-in, Shipment tracking links).

Maybe “Read full topic” is too unprecise for this recquirement:

> Label of button needs to reflect clear action to be taken and must be true to page the user is going to

---

<div class="post-metadata">

### Author: ![Mooash](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mooash/32/189167_2.png) [@Mooash](https://meta.discourse.org/u/Mooash)
#### Post date: [2015年四月23日 22:51 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/10 "2015-04-23T22:51:06Z")

</div>

Shit. I didn’t realise you had to _register_ to use this schema. Thats bogus.

@eviltrout should this turn into a toggle-able option? Having the schema at the bottom of the email doesn’t really change anything since it doesn’t add a large amount to the email (plus its hidden from the clients view)

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [2015年四月23日 23:07 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/11 "2015-04-23T23:07:54Z")

</div>

> [@Mooash](#):
>
> I didn’t realise you had to register to use this schema.

Technically, you only have to register if you want Gmail to render it in their client. 😉

👎

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2015年四月24日 01:47 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/12 "2015-04-24T01:47:28Z")

</div>

> [@Moter8](#):
>
> We are currently only approving Go-To actions for very specific high-value usecase with high interaction rate (e.g. Flight Check-in, Shipment tracking links).

This sounds basically useless. If Google has to individually approve the button for each domain, and each Discourse instance…

Then we should not include this, as it won’t do anything.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2015年四月24日 14:41 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/13 "2015-04-24T14:41:04Z")

</div>

I agree it sounds like we should pull it. It’s useless if every discourse needs to register to have it work.

---

<div class="post-metadata">

### Author: ![Moter8](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moter8/32/120941_2.png) [@Moter8](https://meta.discourse.org/u/Moter8)
#### Post date: [2015年四月24日 16:04 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/14 "2015-04-24T16:04:39Z")

</div>

On the other hand, more mail clients will support this when more services include/use the schemas.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2025年十二月4日 11:35 UTC](https://meta.discourse.org/t/integrate-viewactions-one-click-actions-schemas-into-discourse-emails/27056/15 "2025-12-04T11:35:49Z")

</div>


