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
  1. Defining Channels

Retrieving Channels

Though not a common use case, you can retrieve configured Channel instances using the Megaphone Channel WireBox DSL.

// config/modules/megaphone.cfc
component {

    function configure() {
        return {
            "channels": {
                // this is the unique name for the channel
                "database": {
		    "provider": "DatabaseProvider@megaphone",
		    "properties": {
                        // this is the default table name
                        "tableName": "megaphone_notifications",
                        "datasource": "megaphone"
                    }
                }
            }
        };
    }

}
var databaseChannel = wirebox.getInstance( "megaphone:database" );
PreviousConfigurationNextDefining Notifications

Last updated 1 year ago