Kogno
  • Introduction
  • Getting Started
    • Configuration
    • Starting the Server
    • Messenger Configuration
    • Telegram Configuration
    • WhatsApp Configuration
    • NLP Configuration
  • Conversation Class
  • Contexts
    • Blocks
      • before_anything
      • postback
      • deep_link
      • command
      • any_attachment
      • regular_expression
      • keyword
      • any_number
      • any_text
      • intent
      • entity
      • membership
      • recurring_notification
      • everything_else
      • after_all
    • Sub Contexts
    • Routing
    • Sequences
    • Conversational Forms
  • Replies / Notifications
    • text
    • button
    • quick_reply
    • raw
    • list
    • carousel
    • url
    • typing
    • image
    • video
    • html
    • markdown
    • contact
    • location
    • recurring_notification_request
    • messenger_generic_template
    • whatsapp_template
  • Templates
  • Models
    • User model
  • Scheduled Messages
  • Telegram Inline Query
  • Command Line
  • Global Methods
  • Internationalization
Powered by GitBook
On this page
  • html(code=String, reply_markup=Hash, extra_params=Hash)
  • Platforms
  • Usage
  • HTML Only
  • HTML with replies below
  • From .rhtml template
  • Params

Was this helpful?

  1. Replies / Notifications

html

This method creates a message in HTML format.

html(code=String, reply_markup=Hash, extra_params=Hash)

Platforms

Platform
Supported

Messenger

WhatsApp

Telegram

Usage

HTML Only

@reply.html("<b>bold</b>, <strong>bold</strong> <i>italic</i>, <em>italic</em><u>underline</u>, <ins>underline</ins>")

HTML with replies below

@reply.html(
  "<b> Here the HTML with some quick_replies </b>",
  {
    quick_reply: [
      {
        payload: :option_1,
        title: "Option 1!"
      },
      {
        url: "https://twitter.com/kogno_framework",
        title: "Follow US!"
      }
    ]
  }
)

From .rhtml template

  code = html_template("main/demo1")
  @reply.html(code)

The template "main/demo1" is located in bot/action_templates/main/demo1.rhtml file.

<% 7.times do %>
  <b>Hello</b> <i>World</i>
<% end

Params

Name
Description

code String

Required.

reply_markup Hash

Optional. Hash with one element that can be:

extra_params Hash

PreviousvideoNextmarkdown

Last updated 2 years ago

Was this helpful?

Read more about html_template method .

The HTML code, 4096 characters max. View the full html tags supported by Telegram .

:quick_reply =>

:button =>

Optional. Hash with more params, view the .

here
inlinekeyboardmarkup
replykeyboardmarkup
full list from Telegram
here