diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2014-11-11 18:09:58 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2014-11-11 18:09:58 +0300 |
commit | af154478675f9e3d970dbd9339e0ed23c23a7eec (patch) | |
tree | 3af5c8dc38af4df5975f0127a1f19f8c8cfdce7a | |
parent | 8dc9cb3ddb2aae7d5ba4ad065932a4f4f2e7892e (diff) |
Create emails helper for actions links.
-rw-r--r-- | app/helpers/emails_helper.rb | 20 |
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 |