L
L
lenox942019-11-15 13:01:29
gmail
lenox94, 2019-11-15 13:01:29

Go-To Action button in gmail email with schema.org markup not showing, what am I doing wrong?

https://developers.google.com/gmail/markup/apps-sc... did all the steps from this tutorial:
created a project, created an html file, inserted the code from the tutorial into files, sent an email to my own email, but no buttons as an example from the tutorial did not appear... I found a discussion https://github.com/sendgrid/sendgrid-php/issues/579 in which it was proposed to register in some special way https://developers.google.com/gmail /markup/registe... but I don't fully understand how exactly, so how to fill out a form from Google, with a million fields... I don't really want to do this, is there any normal solution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lenox94, 2019-11-15
@lenox94

It helped me not to export the html file, but to assign the contents of the mail_template.html file to the htmlBody variable:

/**
 * Tests the schema.
 */
function testSchemas() {
  var htmlBody = '<html>
  <head>
    <script type="application/ld+json">
    {
      "@context":       "http://schema.org",
      "@type":          "EmailMessage",
      "description":    "Check this out",
      "potentialAction": {
        "@type": "ViewAction",
        "target":   "https://www.youtube.com/watch?v=eH8KwfdkSqU"
      }
    }
    </script>
  </head>
  <body>
    <p>
      This a test for a Go-To action in Gmail.
    </p>
  </body>
</html>'
  MailApp.sendEmail({
    to: Session.getActiveUser().getEmail(),
    subject: 'Test Email markup - ' + new Date(),
    htmlBody: htmlBody,
  });
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question