From af154478675f9e3d970dbd9339e0ed23c23a7eec Mon Sep 17 00:00:00 2001
From: Marin Jankovski <maxlazio@gmail.com>
Date: Tue, 11 Nov 2014 16:09:58 +0100
Subject: [PATCH] Create emails helper for actions links.

---
 app/helpers/emails_helper.rb | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 app/helpers/emails_helper.rb

diff --git a/app/helpers/emails_helper.rb b/app/helpers/emails_helper.rb
new file mode 100644
index 00000000000..2ef28922ec1
--- /dev/null
+++ b/app/helpers/emails_helper.rb
@@ -0,0 +1,20 @@
+module EmailsHelper
+
+  # Google Actions
+  # https://developers.google.com/gmail/markup/reference/go-to-action
+  def email_action(options)
+    data = {
+      "@context" => "http://schema.org",
+      "@type" => "EmailMessage",
+      "action" => {
+        "@type" => "ViewAction",
+        "name" => options[:name],
+        "url" => options[:url],
+        }
+      }
+
+    content_tag :script, type: 'application/ld+json' do
+      data.to_json.html_safe
+    end
+  end
+end
-- 
GitLab