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
  • id
  • alt
  • title
  • getMemento
  1. Reference
  2. BaseProvider
  3. SlackProvider
  4. SlackMessage

ImageBlock

PreviousHeaderBlockNextSectionBlock

Last updated 1 year ago

init

Creates an ImageBlock instance.

Slack Docs:

Name
Type
Required
Default
Description

imageUrl

string

true

The url for the image. Maximum of 3000 characters.

altText

string

false

"" (empty string)

The alt text for the ImageBlock. If no alt text is provided here, it must be configured using the alt method before serializing.

Return: The ImageBlock instance.

id

Sets a custom identifier for the ImageBlock instance.

Name
Type
Required
Default
Description

id

string

true

The custom identifier for the ImageBlock instance.

Return: The ImageBlock instance.

alt

Sets the alt text for the ImageBlock instance.

Name
Type
Required
Default
Description

altText

string

true

The alt text for the image. Maximum of 2000 characters.

Return: The ImageBlock instance.

title

Sets the title for the ImageBlock instance.

Name
Type
Required
Default
Description

title

string

true

The title for the image. Maximum of 2000 characters.

Return: The ImageBlock instance.

getMemento

Converts the ImageBlock instance to a serializable format.

Name
Type
Required
Default
Description

No arguments

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

{
    "type": "image",
    "image_url": "https://placekitten.com/200/300",
    "alt_text": "A cute kitten",
    "block_id": "optional"
    "text": {
        "type": "plain_text",
        "text": "My Title"
    },
}
https://api.slack.com/reference/block-kit/blocks#image