summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-11-11 16:09:58 +0100
committerMarin Jankovski <maxlazio@gmail.com>2014-11-11 16:09:58 +0100
commitaf154478675f9e3d970dbd9339e0ed23c23a7eec (patch)
tree3af5c8dc38af4df5975f0127a1f19f8c8cfdce7a
parent8dc9cb3ddb2aae7d5ba4ad065932a4f4f2e7892e (diff)
downloadgitlab-ce-af154478675f9e3d970dbd9339e0ed23c23a7eec.tar.gz
Create emails helper for actions links.
-rw-r--r--app/helpers/emails_helper.rb20
1 files changed, 20 insertions, 0 deletions
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