summaryrefslogtreecommitdiff
path: root/app/helpers/emails_helper.rb
blob: 2ef28922ec1dfe36f122c2c8cf41445403407599 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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