messenger_generic_template

Allows the creation of messages from Messenger Generic Templates.

messenger_generic_template(elements=Hash|Array, image_aspect_ration=Enum, quick_replies=Array)

Platforms

PlatformSupported

Messenger

WhatsApp

Telegram

Usage

@reply.messenger_generic_template(
  {
    title: "The Title",
    subtitle: "This is the subtitle",
    image_url: "https://pbs.twimg.com/profile_images/1533726469641338881/Q9dM6DpM_400x400.jpg",          
    default_action: {
      type: :web_url,
      url: "https://kogno.io",
      :webview_height_ratio => :tall,
      messenger_extensions: true
    },
    buttons: [
      {
        type: :web_url,
        url: "https://kogno.io",
        title: "Call to Action ➡️",
        webview_height_ratio: :tall,
        messenger_extensions: true
      }
    ]
  },
  :square,
  [
    {
      title: "Button bellow",
      payload: "some_context/some_payload"
    }
  ]
)

Params

NameDescription

elements Hash|Array

Required.

Can be Hash or an Array of Hashes. View the full structure of elements in Messenger Platform documentation.

image_aspect_ratio Enum

Optional. The aspect ratio used to render images specified by element.image_url. Must be horizontal (1.91:1) or square (1:1). Defaults to horizontal.

quick_replies Array

Optional. Array of buttons that appear below the carousel.

Learn more about Messenger Generic Templates in the official documentation.

Last updated