Microsoft Teams Notifications Package

The Teams Notification package for Laravel lets you send notifications to Microsoft Teams. You can send normal messages, messages with additional details, and even use this package's custom logging channel: use Osama\LaravelTeamsNotification\TeamsNotification; // Normal message new TeamsNotification()->sendMessage("System Notification"); // Message with additional details new TeamsNotification()->sendMessage("System Notification", [ 'Server' => 'Production', 'Status' => 'Running', 'Uptime' => '24 days' ]); // Send a trace try { // ... } catch (\Exception $exception) { new TeamsNotification() ->bindTrace() ->error() ->sendException($exception); } The logging functionality will send messages to a Teams channel using a configured logging channel: Log::channel('teams')->info('This is an info message'); Features Send Normal Messages: Send simple text notifications to Teams. Send Messages with Additional Details: Include extra details in the notification. Send Success Messages: Highlight successful operations with a green color. Send Warning Messages: Indicate warnings with an orange color. Send Error Messages: Report errors with a red color and optional stack trace. Send Messages with JSON Blocks: Include formatted JSON data in the message. Custom Logging: Log messages directly to Microsoft Teams using Laravel’s logging system. Configurable Message Colors: Set custom colors for messages with predefined options. You can learn more about this package, get full installation instructions, and view the source code on GitHub. The post Microsoft Teams Notifications Package appeared first on Laravel News. Join the Laravel Newsletter to get Laravel articles like this directly in your inbox.

Jan 6, 2025 - 17:46
 0
Microsoft Teams Notifications Package

Microsoft Teams Notifications Package

The Teams Notification package for Laravel lets you send notifications to Microsoft Teams. You can send normal messages, messages with additional details, and even use this package's custom logging channel:

use Osama\LaravelTeamsNotification\TeamsNotification;

// Normal message
new TeamsNotification()->sendMessage("System Notification");

// Message with additional details
new TeamsNotification()->sendMessage("System Notification", [
    'Server' => 'Production',
    'Status' => 'Running',
    'Uptime' => '24 days'
]);


// Send a trace
try {
    // ...
} catch (\Exception $exception) {
    new TeamsNotification()
        ->bindTrace()
        ->error()
        ->sendException($exception);
}

The logging functionality will send messages to a Teams channel using a configured logging channel:

Log::channel('teams')->info('This is an info message');

Features

  • Send Normal Messages: Send simple text notifications to Teams.
  • Send Messages with Additional Details: Include extra details in the notification.
  • Send Success Messages: Highlight successful operations with a green color.
  • Send Warning Messages: Indicate warnings with an orange color.
  • Send Error Messages: Report errors with a red color and optional stack trace.
  • Send Messages with JSON Blocks: Include formatted JSON data in the message.
  • Custom Logging: Log messages directly to Microsoft Teams using Laravel’s logging system.
  • Configurable Message Colors: Set custom colors for messages with predefined options.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.


The post Microsoft Teams Notifications Package appeared first on Laravel News.

Join the Laravel Newsletter to get all the latest Laravel articles like this directly in your inbox.

What's Your Reaction?

like

dislike

love

funny

angry

sad

wow