LogoLogo
  • Introduction
  • What's New?
  • Upgrade Guide
  • Getting Started
    • Requirements
    • Installation
  • Defining Channels
    • Configuration
    • Retrieving Channels
  • Creating and Sending Notifications
    • Defining Notifications
    • Notifiables
    • Sending Notifications
  • Providers
    • DatabaseProvider
    • EmailProvider
    • SlackProvider
      • Slack BlockKit
    • Creating Custom Providers
  • Testing
    • Coming Soon
  • Reference
    • NotificationService
    • BaseNotification
    • SendsNotifications
    • INotifiable
    • BaseProvider
      • DatabaseProvider
        • DatabaseNotificationService
        • HasDatabaseNotifications
        • DatabaseNotificationCursor
        • DatabaseNotification
      • EmailProvider
      • SlackProvider
        • SlackMessage
          • EventMetadata
          • ActionsBlock
          • ContextBlock
          • DividerBlock
          • HeaderBlock
          • ImageBlock
          • SectionBlock
          • ButtonElement
          • ConfirmObject
          • ImageElement
          • TextObject
          • PlainTextOnlyTextObject
  • ForgeBox
  • GitHub
Powered by GitBook
On this page
  • init
  • alt
  • getMemento
  1. Reference
  2. BaseProvider
  3. SlackProvider
  4. SlackMessage

ImageElement

PreviousConfirmObjectNextTextObject

Last updated 1 year ago

init

Creates an ImageElement instance.

Slack Docs:

Name
Type
Required
Default
Description

imageUrl

string

true

The url for the image.

altText

string

false

"" (empty string)

The alt text for the image. If alt text is not provided in the constructor, it must be provided using the alt method before serializing.

Return: The ImageElement instance.

alt

Sets the alt text for the ImageElement instance.

Name
Type
Required
Default
Description

altText

string

true

The alt text for the ImageElement.

Return: The ImageElement instance.

getMemento

Converts the ImageElement instance to a serializable format.

Name
Type
Required
Default
Description

No arguments

Return: (struct) A struct representing this ImageElement instance.

{
    "type": "image",
    "image_url": "https://placekitten.com/200/300",
    "alt_text": "A cute kitten"
}
https://api.slack.com/reference/block-kit/block-elements#image