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
  • notify
  • getChannel
  • getChannels
  1. Reference

NotificationService

PreviousComing SoonNextBaseNotification

Last updated 1 year ago

notify

Sends a notification to a single notifiable instance or an array of notifiable instances.

Name
Type
Required
Default
Description

notifiables

| array<>

true

A single Notifiable instance or an array of Notifiable instances that will receive the notification.

notification

string |

true

The notification instance or a string WireBox mapping to send to the notifiables.

properties

struct

false

{}

A struct of properties to populate the notification with.

Return: notification instance, after it has been populated and sent to the notifiables.

getChannel

Returns a channel instance by name.

Name
Type
Required
Default
Description

channelName

string

true

The name of the channel to return.

Return: A instance for the channel name.

Throws: Megaphone.Configuration.MissingChanel

getChannels

Returns a map of channel names to Provider instances.

Name
Type
Required
Default
Description

No arguments

Return: A struct map of channel names to Provider instances.

BaseProvider
INotifiable
INotifiable
BaseNotification